Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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

Comment on Re: readdir() only returns one result when used with
Download Code

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 imbibing at the Monastery: (6)
As of 2015-12-01 05:26 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (794 votes), past polls