in reply to Recursive Subdirectories
This is a task for the File::Find module. The module will recurse through the directory structure for you and call the function you want for each file found. This may be a little confusing if you come from VB or something similar. The find() function from File::Find is like a servant that gets a list of things to do and the place to start from and goes through all files and does whatever is in the list.
use File::Find; sub toDo { return if (-d $_); # I'm not interested in directories if (/\.txt$/i) { print "I found text file $_ in $File::Find::dir\n" } } find( \&toDo, '.');
Jenda
P.S.(OT): Yeah the absence to references/pointers to functions is what I hate most about VB.
All those who understood the topic I just elucidated, please verticaly extend
your upper limbs.
-- Ted Goff
|
|---|