Perl Programming Environment on Webserve

On Webserve, /usr/local/bin/perl and /usr/local/bin/perl5 have been configured to include all the normal Perl modules needed by developers creating web applications. Perl scripts must use bang lines that point to either /usr/local/bin/perl or /usr/local/bin/perl5. Perl scripts that have bang line using other paths will fail. A utility has been developed to help you identify and fix any Perl files that may have an incorrect path set (which may be the case for any web applications that were created on the central web servers prior to the existence of Webserve.)

Running the fix_perl_bang utility

This command line utility will examine and/or modify your Perl bang lines to conform to the requirements on Webserve. To receive a report on the Perl files in your account (no changes will be made), connect to your account on Webserve via SSH and type:

fix_perl_bang

What this utility does is search for all files in your account with either a .pl or a .cgi extension that also have a bang line (e.g. #!/usr/bin/perl or #!/usr/local/bin/perl) that contains the string 'perl'. If you have Perl files in your account without .pl or .cgi extensions, this utility will not find these files - you must locate and correct these files yourself as needed.

By default, when you run this utility it only reports the file and the bang line found, along with those files that have an appropriate bang line and those files for which the bang line should be changed.

Note: This application begins in the current directory and then descends into sub-directories, searching for .pl or .cgi files. Thus, you can execute the utility from sub-directories to limit the search of this application.

After examining a report from this application, you may add 'switches' that will result in the modification of your Perl bang lines to correct them.

Specifically, if you type:

fix_perl_bang -modify -nobackup

The utility will modify all 'incorrect' Perl bang lines and replace it with #!/usr/local/bin/perl. No backup files will be made.

If you type:

fix_perl_bang -modify -backup

This utility will modify all 'incorrect' Perl bang lines and replace it with #!/usr/local/bin/perl. A copy of your original Perl file will be created with a .bak extension.