Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: The dreaded if-elsif-else construct (code)by drinkd (Pilgrim) |
on Nov 17, 2001 at 17:50 UTC ( [id://126014]=note: print w/replies, xml ) | Need Help?? |
This is a very common problem in scientific data processing now, where everybody sells instruments that make thousands and millions data directories with id information in the directory name and files underneath called "data.dat" and "data.log". Go Figure. I think dws above is on the right track. I am sure things are a little more complicated than you alude to, so use File::Find to suck the whole directory structure into a hash, and then use Parse::RecDescent to step through with a simple grammar and do different stuff depending on what it finds. That way next year when the structure (or database) gets slightly more complicated (it always does!), it just takes a slight grammar change. Good luck. drinkd
In Section
Seekers of Perl Wisdom
|
|