Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: readdir fails?

by webadept (Pilgrim)
on Mar 03, 2002 at 04:20 UTC ( [id://148935]=note: print w/replies, xml ) Need Help??


in reply to readdir fails?

My understanding (limited as it is) says that readdir is like reading and array and you need a loop in there to get anything past the . or .. or anything else. Try something like this.
opendir(DIR, $dirname) || die "Horrible Death"; while(defined($file=readdir(DIR)) { print $file, "\n"; } closedir(DIR);
This gets you through all the files in the directory.

Hope that helps out.

webadept.net

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-25 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found