Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: String parsing

by Abigail-II (Bishop)
on Jan 05, 2004 at 12:35 UTC ( #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
Node Status?
node history
Node Type: note [id://318827]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2018-10-18 18:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (104 votes). Check out past polls.

    Notices?