On Mon, Jan 19, 2004 at 09:04:16PM +0000, Mikhael Goikhman wrote: Sorry, i'm going to do a short perl rant...
> Never write: > > open(...); > > If you want to catch problems, write something like: > > open(...) or die "Can't open file $fileName: $!\n"; If he doesn't understand the syntax why should he write it? There are lots of people that say... do it this way... but don't explain why. If you say to someone, you should do it this way... explain why and what the syntax means. For reference, open(MOO,$file) or die "Barf on $file: $!\n"; If the open fails for some reason (permissions?) it will run the code after the "or". So in this case it would die and give the message supplied. $! in perl is a special variable containing any error messages from external sources (ie: the file open). blah... hhhmmm... MJD-ish -- -Scott McWhirter- | -kungfuftr- -- Visit the official FVWM web page at <URL: http://www.fvwm.org/>. To unsubscribe from the list, send "unsubscribe fvwm" in the body of a message to [EMAIL PROTECTED] To report problems, send mail to [EMAIL PROTECTED]
