right tool for the job

Larry Cook lcook at sybase.com
Thu Mar 4 10:30:55 EST 2004


brian wrote:

> I imagine with perl, you could read in the full directory path, split()
> on the /'s and push the resulting individual path locations into an
> array.  If the last value of the array is "exclude" then you exclude the
> directory.  If the last value is "include" or !"exclude" (or whatever
> works for you) then process the directory.

I recommend using the Perl Find module.  It traverses the specified directory 
tree for you, and calls a user specified function for each entry so that you 
can do what you want.

I've been out of Perl a while now, but I have some Perl 4 scripts I can share 
as examples.

Larry



More information about the gnhlug-discuss mailing list