Perl exists as a built-in tool to postgreSQL, it's called pl/perl.
See
PL/Perl
documentation from postgres website
It's simply that using DBI to interface postgres to perl is NOT the best way; but perl integrates extremely tightly and efficiently to postgres.