Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Re: Objects with Private Variables

by diotalevi (Canon)
on Mar 30, 2003 at 17:10 UTC ( #246750=note: print w/ replies, xml ) Need Help??

in reply to Re: Objects with Private Variables
in thread Objects with Private Variables

You missed the key point - the anonymous subroutine is a closure because it "captures" the $type, $class and $self instances. So when you call the function later the $self variable is still accessible from inside $closure thus it all works.

Comment on Re: Re: Objects with Private Variables

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-11-27 11:26 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (725 votes), past polls