Puffin Handbook -- Perl TroubleshootingMany of the difficulties people find in creating Perl applications on the Puffin server is that the great majority of help and resources on the web are aimed at Perl scripts running on a UNIX server. Puffin runs on an NT machine, so allowances need to be made for this. Permissions Permissions are the 'rights' to view, modify, and delete files. Everyone has read rights to files on the Puffin server, as it is a web server, and read rights are necessary. When I say everyone, I generally mean other Puffin users FTPing, and web users, the people looking at your web pages. Whe you make a cgi script which makes, modifies, or deletes a file, you must set the permissions on that file or folder so that people viewing your web page can modify information through the use of your scripts. You can't set your permissions yourself, you need to get the Puffin Guy to do it for you. The best way to do it is to create a folder in which you will place the output from your scripts. Then email me at puffinhelp@ptialaska.net and let me know the name of the folder you wish me to set the permissions for. If you ask me during business hours, I can usually set it up in a half hour or so. I check my email quite frequently.
File and URL Mapping Another stumbling block is the different ways UNIX and NT handle mappings and directories. In many scripts, you will need to know the 'absolute' path of your user directory. This path is:
e:\puffindocs\home\
On the other hand, the URL mapping to your site will be http://puffin.ptialaska.net/yourusername or possibly http://puffin.ptialaska.net/~yourusername if you were on the old server. You need the absolute, or file location of your directory when you are writing to and reading from files. You need the web location, or URL, when you are creating on the fly links. Locating Perl on the Server You will find that almost all Perl scripts begin with a line like this:
You can omit that line completely. It is unnecessary for scripts on the Puffin server. Debugging Did you know that you can run your Perl programs from the command line? Even ones that are specifically designed for the web. The output you receive may be invaluable in debugging the script. Here is how you do it: E:\puffindocs\home\keitha\cgi-bin>perl myscript.plFile Extensions Use the extension .pl for your Perl scripts.
|