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"; } }
In reply to Re: path greping
by ryddler
in thread path greping
by Sara
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |