develooper Front page | perl.perl5.porters | Postings from March 2006

Re: [perl #38790] readdir() only returns one result when used withFatal.pm

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
March 23, 2006 09:25
Subject:
Re: [perl #38790] readdir() only returns one result when used withFatal.pm
Message ID:
20060323182541.5bba29c6@grubert.mandriva.com
Joshua ben Jore wrote:
> 
> So hardcode the exceptions. They're well established and limited.
> Heck, for readdir(), if it returned an empty list/undef, why isn't $!
> being examined to decide failure? It isn't that failure is
> undetectable, it just isn't a case of looking at the return value
> because any of empty/false/undef/-1/0 are possible as non-error
> returns.

Not sure, I think all directories have always at least one entries.
At least on Unixes.

> It could be considered the responsibility of a core module like Fatal
> to handle all the various exceptional return values. I sure do. I also
> see no reason why Fatal can't do the right thing. So why is it that
> Fatal has to just document this as a limitation? It's possible for
> Fatal to handle list context readdir, right? If so, it should.

Yes, seems reasonable. and patches speak louder than words :)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About