Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: searching folder for specific files

by hanenkamp (Pilgrim)
on Feb 23, 2004 at 09:32 UTC ( [id://331105]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to searching folder for specific files

There are actually several ways of doing this. You should look for documentation on glob for one:
do_something($_) foreach (<*.swf>);
You can use opendir, readdir, and closedir and use a regexp or other file-test operation against each file found to determine if it matches your criteria:
opendir FOO, $dir or die $@; foreach (readdir FOO) { do_something($_) if /\.swf$/; } closedir FOO;
Or, if you need to recurse into subdirectories, you should consider File::Find. I'll let the documentation at CPAN illuminate that one for you.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://331105]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.