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

Re: Opening a Directory

by wog (Curate)
on Jan 19, 2002 at 01:55 UTC ( #139964=note: print w/ replies, xml ) Need Help??

in reply to Opening a Directory

If the directory name has a space in between, what should I do?

If you call out to a shell command using the name of the direcotry use quotes or, better, the multi-argument form of system or exec (update: oops, open doesn't have which accepts an arbitrary number of arugments. If you want to not have spaces or quotes be an issue and to capture the output of or send input to a command use open and exec's multi-argument form.) Otherwise, perl's internal functions (rmdir, mkdir, chmod, etc.) and any modules shouldn't have a problem.

And how to capture all the files under a directory?

I'd reccommend File::Find, since that'll do the recursion necessary (into subdirectories, etc.). (But you can use opendir, readdir, and closedir directly, if you really want to.)

Comment on Re: Opening a Directory

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2015-11-25 13:33 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 (675 votes), past polls