Coder's Guild Mailing List

on error checking (was: Re: Reading and writing PERL arrays)

Posted by Peter Palfrader on 2000-04-09

Hallo G.P.Gillis!

G.P.Gillis schrieb am Sonntag, dem 09. April 2000:

> open FILE, "file.dat" or die "Can not open file for input!\n";

actually you want: ... die "Can not open file for input: $!\n";


> open FILE, "+> file.dat" or die "Can not open file for output!\n";
and die "Can not open file for output: $!\n";


$! contains the reason the open failed.



> 
> begin 600 WINMAIL.DAT
> M>)\^(C ``0:0" `$```````!``$``0>0!@`(````Y 0```````#H``$(@ <`

WTF is that?

				yours,
				peter
--
http://www.cosy.sbg.ac.at/~ppalfrad
To signoff send a mail to listserver@xxxx.xx.xx with 
  "signoff tcg" in the body of your message.