Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Perl List files in directory

by hippo (Parson)
on Apr 22, 2014 at 11:26 UTC ( #1083142=note: print w/ replies, xml ) Need Help??

in reply to Perl List files in directory

You wrote:

opendir(DIR, "/opt/tmp/" or die "Cannot open dir");

whereas what you probably meant was:

opendir(DIR, "/opt/tmp/") or die "Cannot open dir";

Better would be:

opendir(DIR, "/opt/tmp/") or die "Cannot open dir: $!";

Perhaps better still would be DirHandle but YMMV.

Comment on Re: Perl List files in directory
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2015-11-25 09:04 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 (672 votes), past polls