Your skill will accomplish what the force of many cannot |
|
PerlMonks |
parsing directory glob in config fileby gnu@perl (Pilgrim) |
on Sep 13, 2002 at 18:55 UTC ( [id://197694]=perlquestion: print w/replies, xml ) | Need Help?? |
gnu@perl has asked for the wisdom of the Perl Monks concerning the following question:
I am writing a program to maintain log files. I know there are a ton of things out there to do this, but I am kind of a roll your own guy. I learn more when I write it than when I use anothers.
Anyway, I have a config file like the following:
The first part is the path glob and the second is the maximum mtime to keep. As you can see, the first line of the config file would not parse correctly in an opendir/readdir combination. I would like to be able to retain this globbing ability in the config file, otherwise the top line would turn into over 100 lines if I had to enter each one seperatly. Any Ideas on how I can use this glob quickly and efficiently in a perl program (*nix environment). TIA,
Chad
Back to
Seekers of Perl Wisdom
|
|