Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: String parsing

by Abigail-II (Bishop)
on Jan 05, 2004 at 12:35 UTC ( [id://318827]=note: print w/replies, xml ) Need Help??


in reply to Re: String parsing
in thread String parsing

Your data lines are different enough that each type needs its own parser.
Uhm, no, as shown in several other replies.
A hash of coderefs ("dispatch table") will do that nicely,
Actually, your solution is very inflexible. It can't even deal with:
WARNING(2): system is rebooting
(only the exit value is different from the original). It'll produce an error, as Perl will try to use an undefined value as a code reference.

Abigail

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-16 23:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found