[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] IO:: problems (fwd)



According to Brian L. Matthews:
> 
> With white space at the end, the open fails, so the print fails as
> well. Both return an error, but because the little example doesn't
> do any error checking, you don't get any error messages. It would be
> completely and horribly wrong for either open or print to output
> their own error messages instead of returning an error.

I don't think it would be all that horrible.  Nor is it
completely wrong.  I've done:

	open( X, "y" ) || die "Couldn't open Y.";

lots of times even though:

	open( X, "y" ) || die $!;

prints much better error messages.  Sometimes it's because
of the large number of OPEN statements I'm using.  I've
also found that always putting the filename is double
quotes helps prevent "Not Found" statements.


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch