AcidHawk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am wanting to search for file names that conform to a certain pattern. I want to read the pattern from a config file, something like aaaa-nnnnnnnn. The config part is not the problem, the template bit is. This config value should match files that have 4 alpha characters, then a -, then 8 numeric characters.
I have looked (a bit) for template modules but the majority of these are for HTML.
Some pseudo code to try and help explain.
The files I want to do something with look something like ABCD-13022003*.* or even ZZZZ-99999999*.* I would also like to be able to change the config to something like aa-nn-aa, which would match XX-55-DD*.* files.*** Get aaaa-nnnnnnnn from config file *** I am using XML::Simple while ($file = readdir DIR) { next if $file =~/^\./ || $file not matched by $filename_template; *** Carry on to do something with a file that does conform...
Has anyone any direction to point me in?
-----Of all the things I've lost in my life, its my mind I miss the most.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Filename Template
by Abstraction (Friar) on Aug 07, 2003 at 14:48 UTC | |
by broquaint (Abbot) on Aug 07, 2003 at 15:00 UTC | |
by Limbic~Region (Chancellor) on Aug 07, 2003 at 15:06 UTC | |
by l2kashe (Deacon) on Aug 07, 2003 at 15:26 UTC | |
Re: Filename Template
by larsen (Parson) on Aug 07, 2003 at 14:50 UTC | |
by dragonchild (Archbishop) on Aug 07, 2003 at 15:23 UTC | |
by larsen (Parson) on Aug 07, 2003 at 16:14 UTC |
Back to
Seekers of Perl Wisdom