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 Whiplash
Make Your Die Messages Full of Wisdom!Get YOUR PerlMonks Stagename here!
Want to speak like a Londoner?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Seeking Feed back
by orkysoft (Friar) on Jul 05, 2001 at 13:04 UTC | |
by tilly (Archbishop) on Jul 05, 2001 at 15:58 UTC | |
by azatoth (Curate) on Jul 05, 2001 at 16:20 UTC | |
by tilly (Archbishop) on Jul 05, 2001 at 18:01 UTC | |
by pmas (Hermit) on Jul 05, 2001 at 18:03 UTC | |
by azatoth (Curate) on Jul 05, 2001 at 18:06 UTC | |
by orkysoft (Friar) on Jul 05, 2001 at 16:53 UTC | |
by tilly (Archbishop) on Jul 05, 2001 at 17:52 UTC | |
by orkysoft (Friar) on Jul 06, 2001 at 01:52 UTC | |
by Chady (Priest) on Jul 05, 2001 at 15:46 UTC |
In Section
Seekers of Perl Wisdom