What permissions do I need to set for my Perl script files?
The correct permissions for Perl script files depends on the script’s particular function:- For Perl script files that are publicly accessible through the web, you should set the file permissions to 755 (read, write, and execute permissions for the user, and read and execute permissions for the group and world). You do not need to give the world write permissions to the Perl script.
- For Perl script files that you only run on the command line, you should set the file permissions to 700 (read, write, and execute permissions for the user, and no permissions for the group and world).
A Perl script may need to open a file for write access. For example, guestbooks and bulletin boards often must write data to a particular file. Files that must be writable by Perl scripts can use the default file permissions of 644 (read and write permissions for the user, and read permissions for the group and world).
What file extensions can I use for my Perl script files?
Perl script files can have a .pl or .cgi extension. However, like file permissions, the file extension depends on the script’s particular function:- Perl script files that generate web output accessible to the public should use the .cgi extension.
- Perl script files that you only run from the command line, and script files which do not generate web output, should use the .pl extension.