Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: recurse directories?

by Dominus (Parson)
on Mar 12, 2000 at 03:25 UTC ( [id://5229]=note: print w/replies, xml ) Need Help??


in reply to recurse directories?

You want to use the File::Find module that comes with Perl. With File::Find you tell it what directory you want to search, and you supply a wanted subroutine that it invokes on every file that it finds. Inside of wanted, you get to do whetever you want, or you can just return immediately if you're not interested in a particular file. Your wanted might look like this:

	sub wanted {
	  return unless /\.mp3$/ || /\.pl$/;
	  # do something with the .mp3 or .pl file
	}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 05:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found