Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: if variants

by itub (Priest)
on Oct 19, 2004 at 12:31 UTC ( #400490=note: print w/ replies, xml ) Need Help??


in reply to if variants

Note that you can do more than one thing on a "one-line if" by using the comma operator:

$state = 3, next if $tok eq 'a';


Comment on Re: if variants
Download Code
Replies are listed 'Best First'.
Re^2: if variants
by dimar (Curate) on Oct 19, 2004 at 15:34 UTC

    or more generally, with a CODEREF

    sub{ MowLawn(); WashCar(); InvadePakistan();}->() if $bNotRaining;
Re^2: if variants
by Anonymous Monk on Oct 19, 2004 at 14:11 UTC
    Or more generally, with a do statement:
    do {local($,) = (','); print(@array);} if $tok eq 'a';

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2015-07-29 07:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls