PL/Perl allows you to write functions in the Perl programming language that may be used in SQL queries as if they were built into PostgreSQL.
The PL/Perl interpreter (when installed as trusted interpreter with default name plperl) is a full Perl interpreter. However, certain operations have been disabled in order to maintain the security of the system. In general, the operations that are restricted are those that interact with the environment. This includes file handle operations, require, and use (for external modules). It should be noted that this security is not absolute. Indeed, several Denial-of-Service attacks are still possible - memory exhaustion and endless loops are two examples.
When PL/Perl is installed as "untrusted" interpreter (with name plperlu), everything is permitted, and any Perl code can be loaded (by a superuser only).