PL/Perl, as an imperative programming language, allows more control than the relational algebra of SQL. Programs created in the PL/Perl language are called functions and can use most of the features that the Perl programming language provides, including common flow control structures and syntax that has incorporated regular expressions directly. These functions can be evaluated as part of a SQL statement, or in response to a trigger or rule.
The design goals of PL/Perl were to create a loadable procedural language that:
- can be used to create functions and trigger procedures,
- adds control structures to the SQL language,
- can perform complex computations,
- can be defined to be either trusted or untrusted by the server,
- is easy to use.