Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to The dreaded if-elsif-else construct (code)

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://126014]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-03-28 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found