Creating a Script
-
Start it in Notepad, FTP it.
-
Or, do it all in pico.
-
Start with the shebang line (#!), which tells the web server where to find
the Perl interpreter.
-
You have to change the file's permission on oz. Some servers do that
automatically, but you must specify it in oz.
-
At the prompt, type chmod 755 script.pl
-
Where script.pl is the name of the script you want to run.
-
Each number means something. If you really want to what know, ask
me. Otherwise, know that 755 means you can read/write/execute, and
the rest of the world can read and execute the file.
-
Comments
-
You know they are very important.
-
In Perl, the pound or number sign is what starts a comment.
-
Example: # This is a commented line.
-
In this class, as in real life, comments are important!
-
Check Syntax
-
This is as far as debugging goes here.
-
Type perl -c script.pl to let Perl take a cursory glance at your script.
-
Beyond that, if it does not work, you will get a 500-series error when
you try to run it.
-
Some ISPs actually provide a debug-log of sorts when you get this error.
This is not available on oz.
-
The key: write your script in chunks and test it as you add more to
it!
Forget What I Just Told You
Home