Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Fun with Closures

by dada (Chaplain)
on Mar 26, 2003 at 08:11 UTC ( #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? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2022-07-01 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (99 votes). Check out past polls.

    Notices?