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

Re: help with search script

by steves (Curate)
on Nov 06, 2004 at 16:45 UTC ( #405781=note: print w/replies, xml ) Need Help??


in reply to help with search script

If you know all the directories, as your code seems to indicate, a simple way would be to define them as an array like this:

my @paths_to_images = ("/webpics/originals/", "/webpics/itemthumb/", "/webpics/itemmed/");
Then loop over them like this:
foreach my $dir (@paths_to_images) { # Call the code you have for one directory now }
You could either take the code you have an put it into the for loop block, or make what you have a sub and call it where my comment is.

For more complete directory recursion, use something like File::Find or roll your own using opendir/readdir/closedir.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://405781]
help
Chatterbox?
[LanX]: cho: your joke has very limited impact on a non German+Czech speaking board ... we need to create one and invite Lichtkind and "Peta...Monk"
[Eily]: I still don't understand how the Turkish AA fit into the German+Czech joke though :P
[LanX]: new Firefox + cb sidebar do random auto expand on submit

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2017-03-27 12:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (319 votes). Check out past polls.