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

Re: Opening a Directory

by wog (Curate)
on Jan 19, 2002 at 01:55 UTC ( [id://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.)

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-23 16:30 GMT
Find Nodes?
    Voting Booth?

    No recent polls found