PostgreSQL PL/Perl extension, the main advantage is that allows us, within stored functions, of the manifold "string munging" operators and functions available for Perl. 
To install PL/Perl extension in your particular database use the command below,


$ sudo apt-get install -y postgresql-plperl-11


Login to the database,

$ psql postgres -h <HOST NAME> -p 5432 -U <USER NAME>

or 

$ psql -U postgres


postgres=> CREATE EXTENSION plperl;

CREATE EXTENSION

postgres=> select * from pg_language;

 lanname  | lanowner | lanispl | lanpltrusted | lanplcallfoid | laninline | lanvalidator | lanacl 
----------+----------+---------+--------------+---------------+-----------+--------------+--------
 internal |       10 | f       | f            |             0 |         0 |         2246 | 
 c        |       10 | f       | f            |             0 |         0 |         2247 | 
 sql      |       10 | f       | t            |             0 |         0 |         2248 | 
 plpgsql  |       10 | t       | t            |         13994 |     13995 |        13996 | 
 plperl   |       10 | t       | t            |       1254632 |   1254633 |      1254634 | 
(5 rows)


Also, you do it from the shell command line use,


$ createlang plperl <DATABASE NAME>