Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Ternary Operator with Subroutine

by biohisham (Priest)
on Aug 11, 2011 at 23:08 UTC ( [id://919963]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    hisham@bioslayer:~$ perl -
    my $subref = sub{print 'a',"\n";};
    ...
    (my $test)?print 'c' : &{$subref}; #dereference with &{}
    __END__
    a
    
  2. or download this

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-18 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found