in reply to Re^4: Reading Directory and getting pattern from a file
in thread Reading Directory and getting pattern from a file
get a pattern from a text filedo you mean
I like Path::Tiny for such tasks, e.g. the following would show you all files in the tree where the name starts with "mdp". Note this doesn't use shell patterns like glob (with * and ?) but perl's own regexes.
use strict; use warnings; use Path::Tiny qw/path/; for ( path('/nfs/fm/stod/stod1031/w.eakanoje.101/power/')->children( q +r/^mdp/ ) ) { print $_ . $/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Reading Directory and getting pattern from a file
by Eshan_k (Acolyte) on Feb 12, 2015 at 00:27 UTC |