Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: readdir() only returns one result when used with

by Tomte (Priest)
on Apr 11, 2006 at 09:19 UTC ( #542491=note: print w/replies, xml ) Need Help??

in reply to readdir() only returns one result when used with

Seems to be a bug in context evaluation in FATAL, this code works and throws an exception when readdir returns undef:

#!/usr/bin/perl use strict; use warnings; use Fatal qw(readdir); $| = 1; my $start_dir = '.'; opendir(my $dir, $start_dir); while($_= readdir($dir)) { print "$_ "; } closedir $dir;

Update 2006/04/28: This apparently isn't a bug in Fatal, but simply the fact that readdir can't be correctly "fatalized" 'cause it doesn't clearly indicates failure (and only failure) returning a false value. The documentation of Fatal will be updated to reflect better when to use it.


An intellectual is someone whose mind watches itself.
-- Albert Camus

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://542491]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2016-10-21 13:49 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (289 votes). Check out past polls.