Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: What does return() mean?

by AnomalousMonk (Archbishop)
on Oct 28, 2014 at 02:41 UTC ( [id://1105236]=note: print w/replies, xml ) Need Help??


in reply to Re^2: What does return() mean?
in thread What does return() mean?

If you actually want to return a code/subroutine reference see sub or the  \ operator (see Symbolic Unary Operators in perlop)

c:\@Work\Perl>perl -wMstrict -le "sub S { return sub { print qq{hiya $_[0]}; }; } ;; my $coderef = S(); $coderef->('sailor') " hiya sailor

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found