On Thu, 3 Aug 2000, Simon Cozens wrote:

> On Wed, Aug 02, 2000 at 04:26:56PM -0700, Nathan Wiger wrote:
> > I tend to agree with Tom's argument here. open() is kind of funny
> > anyways. Why couldn't it work like this, similar to FileHandle:
> > 
> >    $fh = open $filename;
> 
> Testing for failure. It's a basic tenet that system calls can be
> tested for success and failure by their returned truth values. I
> believe we should keep this.
> 

Except that you can test for failure by checking to see if $fh is defined.
This is how IO::File does it

 $fh = new IO::File("< $filename");

and it returns undef on failure.


-- 
Tim Jenness
JCMT software engineer/Support scientist
http://www.jach.hawaii.edu/~timj


Reply via email to