Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

•Re^7: How to de-reference a coderef?

by merlyn (Sage)
on Dec 10, 2004 at 00:06 UTC ( [id://413722]=note: print w/replies, xml ) Need Help??


in reply to Re^6: How to de-reference a coderef?
in thread How to de-reference a coderef?

Well, a trivial implementation of Sub is
sub Sub (&) { return shift }
but that doesn't do the blessing and overloading. You'll get to use the syntax of:
my $s = Sub { print +shift } $s->('hello');
just as I indicated before.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-19 12:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found