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

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

Thread Previous | Thread Next
Rafael Garcia-Suarez
March 23, 2006 09:25
Re: [perl #38790] readdir() only returns one result when used
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About