Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Multi-stage flip-flop?

by LanX (Saint)
on Dec 11, 2014 at 01:09 UTC ( [id://1109995]=note: print w/replies, xml ) Need Help??


in reply to Multi-stage flip-flop?

if I understand you right this can be achieved with a function mff() (multi_flip_flop) encasulating the logic and returning the stage number starting with 1.

 (\&doOtherProcessing, \&doStage1(), \&doStage2(),  \&doStage3())[ mff(/match1/, /match2/, /match3/, /match4/) ] ->()

or

if ( my $stage = mff(/match1/, /match2/, /match3/, /match4/) ) { if ( $stage == 1 ) { ... } elsif ( $stage == 2) { ... } ... } else { doOtherProcessing(); }

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-25 16:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found