Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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.)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://139964]
[LanX]: so it was the will of the people to take back control
[LanX]: ;)
[marto]: and you still can't get a decent cup of tea in that town
[davies]: The turnout, IIRC, was about 12%.
[< & >]: 12% seriously? =)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2017-12-15 19:09 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (442 votes). Check out past polls.