Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Recursive Subdirectories

by !unlike (Beadle)
on Apr 16, 2003 at 16:50 UTC ( #250967=note: print w/replies, xml ) Need Help??


in reply to Recursive Subdirectories

You need to seperate your searching code off into a subroutine. Something like this might work:

parse_dir('.'); sub parse_dir { my $path = shift; opendir(HERE, $path) or die "$!\n"; while(readdir(HERE)) { next if /^\.(\.)[0,1]$/; parse_dir($_) if -d $_; #parse files here }

I'm sure others will offer a better solution.

!unlike

I write my Perl code like how I like my sex: fast and dirty. ;)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2023-06-09 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (35 votes). Check out past polls.

    Notices?