Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

(tye)Re: A demanding parser

by tye (Sage)
on Jan 26, 2002 at 00:11 UTC ( #141625=note: print w/replies, xml ) Need Help??

in reply to A demanding parser

I'd certainly drop the && do { ... redo } hack which I find to be not even close to worth the "surprise" factor (plus the maintainance problems of not noticing when you forget a "redo"). And I'd add a different hack (single-argument for) which I think offers a big win in this specific case:

for( $self->{gamedescr}{Game} ) { while( ! m/\G\z/mgc ) { if( m/\G($REnumber)\s*/mgc ) { my $num=$1; #... } elsif( m/\G($REanymove)\s*/mgc ) { push @{$self->{GameMoves}}, $1; $color = $switchcolor{$color}; } elsif( m/\G($REcomment|$REeolcomment|$RERAV|$RENAG|$REe +scape)\s*/mgc ) { #... } else { die "Invalid input..."; } } }

        - tye (but my friends call me "Tye")

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://141625]
[marto]: FWIW, people shipping things as perl, which aren't strictly perl can cause confusion (Perl and OpenWrt - where to the communities intersect?)
[marto]: cpanm is lighter on resources than cpan, which is handy when working with consumer grade NAS hardware

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2018-03-17 13:21 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (224 votes). Check out past polls.