Think about Loose Coupling | |
PerlMonks |
Efficiency Questionby PrimeLord (Pilgrim) |
on Mar 21, 2002 at 19:28 UTC ( [id://153394]=perlquestion: print w/replies, xml ) | Need Help?? |
PrimeLord has asked for the wisdom of the Perl Monks concerning the following question:
Hello fellow monks. I am not sure if I chose the best title, but its all I could think of. I am wondering if there is a better way to accomplish the task I am working on.
I am working on a script that reads the names of several directories into a hash and then 1) prints the keys to that hash into a benchmark file and 2) prints a report of all the dirs it found. I was later asked to add the ability to read some dir names from a config file and that those names should be skipped in the printed report, but should still be printed into the benchmark file. Here is the solution I came up with. I have stripped the code down to what should be the relevant parts.
Now that works, but it just seems like there has to be a better way to do that. Any suggestions? If it helps some examples of what would be in the config file would be things like /home and some of the found dirs would be things like /home/bob and /home/ted. Thanks. -Prime
Back to
Seekers of Perl Wisdom
|
|