Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Fun with Closures

by dada (Chaplain)
on Mar 26, 2003 at 08:11 UTC ( [id://245881]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # an object could manipulate itself
    &$object("add-msg", "get-self", sub {return $object});
    
  2. or download this
    my $object = make_object();
    &$object("add-msg", "get-self", sub {return $object});
    ...
    print &$copy("get-self"), "\n";
    $object = 42;
    print &$copy("get-self"), "\n";
    
  3. or download this
    CODE(0x18350d8)
    42
    

Log In?
Username:
Password:

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

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

    No recent polls found