in reply to Seeking Feedback on Chat Program (was Seeking Feed back)
For starters, all people new to Perl should be made aware of strict.pm. This is a Perl Module that ensures your program runs smoothly with regard to Scoping. You should also read up on use warnings; or the -w switch, which basically adds an extra level of integrity to your program.
Also on your filehandle call, you should always finish the statement off with or die "Could not open $fh : $!\n";
The die function enables error handling, storing the error value in the special variable $!. So your code should now look like
In fact, you should use die on most function calls. Read up on that, it'll save you a lot of heartache in the future.open CHAT, ">>../chatty2.html" or die "Could not open file : $!\n"; # your script will fail if you can't open the file, and print the reas +on why
Finally, enjoy your time on Perlmonks. It's a very nice place.
Azatoth a.k.a Captain WhiplashMake Your Die Messages Full of Wisdom!
|Replies are listed 'Best First'.|
Re: Re: Seeking Feed back
by orkysoft (Friar) on Jul 05, 2001 at 13:04 UTC