![]() |
|
P is for Practical | |
PerlMonks |
Finding un-paired files in a directoryby inman (Curate) |
on Dec 02, 2003 at 11:36 UTC ( #311585=perlquestion: print w/replies, xml ) | Need Help?? |
inman has asked for the wisdom of the Perl Monks concerning the following question:
I am working with a directory that contains both data files and marker files. The marker files have the same base name as the data files but a different extension. They are used as markers that identify the data files that are no longer used. As a result, the files exist as pairs unless they are current in which case only the data file is present. An example directory listing would contain:
I want to work with all of the current data files so I am using the code below to find the list of data files that does not have a corresponding marker file.
This code works just fine but I would like the opinion of more learned monks as to how this code can be improved. A couple of things spring to mind:
All comments gratefully received!
Back to
Seekers of Perl Wisdom
|
|