To run a Perl script in Ubuntu:
- Find the interpreter/executors path. In this case its /usr/bin/perl or /usr/bin/env perl.
- Add it to the first line of the file as #!/usr/bin/perl .
- Give execute permission to the file chmod +x example.pl.
https://linuxapt.com/blog/43-create-and-run-a-perl-script-in-ubuntu-20-04-lts