In Apache web server, by default perl script run from cgi-bin folder only.
cgi-bin is a special directory that is spefified in httpd.conf
ScriptAlias /cgi-bin/ “/home/cgi-bin/”
In this cgi-bin you can run any scripts, perl or even binary executables.
In cpanel servers, you can run Perl script with .pl or .cgi file extension from any folder. This is a great feature as you can run perl scripts from any folder.
To make your web server run perl script from any folder, add following line to your httpd.conf file and restart the webserver.
AddHandler cgi-script .cgi .pl