in reply to path greping
Update: As Arien pointed out, my regex was a bit off in matching .txt extensions, and just in case a file came in as .TXT I added the 'i' after the regex as welluse File::Find; find(\&wanted, '/clear/pp_00/ngbb'); sub wanted { next unless m|\.txt\z|is; if ($File::Find::name =~ m|/clear/pp_00/ngbb/([^/\\]+?)[/\\].*|) { print "the someName dir is $1\n"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re(2): path greping
by Arien (Pilgrim) on Aug 29, 2002 at 22:35 UTC |