Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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?
NodeReaper reads the Necronomicon

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2018-07-19 23:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (421 votes). Check out past polls.

    Notices?