Gossamer Forum
Home : General : Perl Programming :

Re: Please help me!!!

Quote Reply
Re: Please help me!!! In reply to
I don't know about you, but this code scares the bejeebers out of me. Smile

Things like:

Quote:
if(-e "$InDir/$ENV{'QUERY_STRING'}") {
open(IN, "$ENV{'QUERY_STRING'}");

or worse:

Quote:
open(INFO, ">$InfoDir/$form{'id'}");

I would not recommend putting this code on anyone's server. It would be very easy to cause damage, or crash the script (that's my impression from a 5 minute glance).

A good way to check if your program follows good programming practices is to check if open() calls and other system calls are checked for errors. Novice programmers will often do:

open (IN, "blah.txt");

and not check to see if the open was successful. This will cause the script to continue running when it should have coughed up an error, leading to possible disasertous results..

Just my 0.02..

Alex
Subject Author Views Date
Thread Please help me!!! jpop 4319 Jan 6, 1999, 11:01 PM
Post Re: Please help me!!!
jpop 4182 Jan 6, 1999, 11:06 PM
Post Re: Please help me!!!
fhirsch 4168 Jan 7, 1999, 6:05 AM
Post Re: Please help me!!!
Alex 4178 Jan 7, 1999, 9:09 PM
Post Re: Please help me!!!
jpop 4179 Jan 8, 1999, 12:18 AM
Post Re: Please help me!!!
jpop 4164 Jan 8, 1999, 10:19 PM