Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Re: Beginners guide to File::Find

by CukiMnstr (Deacon)
on May 26, 2003 at 16:42 UTC ( #260854=note: print w/ replies, xml ) Need Help??

in reply to Re: Beginners guide to File::Find
in thread Beginners guide to File::Find

You don't see any difference when changing the no_chdir parameter because you are just printing $File::Find::name which is the full path of the file, and no_chdir does not change that. If you print $_ instead, you can see the difference: with no_chdir set to 1, the filename will be relative to the directory you specified for find() to begin the search (since it will not change dirs as it traverses the filesystem tree). If no_chdir is set to 0, then find() will chdir into dirs as it traverses the tree, giving you the filename (relative to that file's directory) in $_.

The no_chdir option isn't what you want to implement GNU find's maxdepth, check Aristotle's reply to this thread instead.

hope this helps,

Comment on Re: Re: Beginners guide to File::Find
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2015-10-09 21:04 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (251 votes), past polls