> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/19/server-programming/plperl.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 第 43 章 PL/Perl — Perl 程序語言

### 第 43 章 PL/Perl — Perl 程序語言

**目錄**

* [43.1. PL/Perl 函式與引數](https://docs.postgresql.tw/19/server-programming/plperl/plperl-funcs.md)
* [43.2. PL/Perl 中的資料值](https://docs.postgresql.tw/19/server-programming/plperl/plperl-data.md)
* [43.3. 內建函式](https://docs.postgresql.tw/19/server-programming/plperl/plperl-builtins.md)
  * [43.3.1. 從 PL/Perl 存取資料庫](https://docs.postgresql.tw/19/server-programming/plperl/plperl-builtins.md#plperl-database)
  * [43.3.2. PL/Perl 中的公用函式](https://docs.postgresql.tw/19/server-programming/plperl/plperl-builtins.md#plperl-utility-functions)
* [43.4. PL/Perl 中的全域值](https://docs.postgresql.tw/19/server-programming/plperl/plperl-global.md)
* [43.5. 受信任與不受信任的 PL/Perl](https://docs.postgresql.tw/19/server-programming/plperl/plperl-trusted.md)
* [43.6. PL/Perl 觸發程序](https://docs.postgresql.tw/19/server-programming/plperl/plperl-triggers.md)
* [43.7. PL/Perl 事件觸發程序](https://docs.postgresql.tw/19/server-programming/plperl/plperl-event-triggers.md)
* [43.8. PL/Perl 的內部運作](https://docs.postgresql.tw/19/server-programming/plperl/plperl-under-the-hood.md)
  * [43.8.1. 組態設定](https://docs.postgresql.tw/19/server-programming/plperl/plperl-under-the-hood.md#plperl-config)
  * [43.8.2. 限制與缺少的功能](https://docs.postgresql.tw/19/server-programming/plperl/plperl-under-the-hood.md#plperl-missing)

PL/Perl 是一種可載入的程序語言，讓你能夠以 [Perl 程式語言](https://www.perl.org)撰寫 PostgreSQL 函式與程序。

使用 PL/Perl 的主要優點，在於它讓你可以在已儲存的函式與程序中，使用 Perl 所提供的各式各樣「字串處理」運算子與函式。相較於 PL/pgSQL 所提供的字串函式與控制結構，使用 Perl 剖析複雜字串可能會比較容易。

若要在特定資料庫中安裝 PL/Perl，請使用 `CREATE EXTENSION plperl`。

#### 提示

如果某個語言已安裝到 `template1` 中，那麼之後所有新建立的資料庫都會自動安裝該語言。

#### 注意

使用原始碼套件的使用者，必須在安裝過程中特別啟用 PL/Perl 的建置（更多資訊請參閱[第 17 章](https://docs.postgresql.tw/19/server-administration/installation.md)）。使用二進位套件的使用者，可能會發現 PL/Perl 位於獨立的子套件中。

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/plperl.html)（原文版本：18.6；核對日期：2026-09-15）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/19/server-programming/plperl.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
