|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re: Can I use a regex here?by repson (Chaplain) |
| on Apr 17, 2001 at 05:49 UTC ( #73029=note: print w/ replies, xml ) | Need Help?? |
|
Since the filenames follow a pattern, if the number of files is indeterminate or you perfer not to use the individual declarations shown above, you could do something like this: rename $_, $OUT_DIR . "/allfiles/$_" for (glob 'pair*' . $RUN_NAME . '.log'); Alternately you could use opendir and readdir with a regex to check the filename instead using of shell-like globbing.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||