Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Hiding, but maintaining variables in user-defined code

by gumpu (Friar)
on May 23, 2001 at 10:00 UTC ( [id://82478]=note: print w/replies, xml ) Need Help??


in reply to Hiding, but maintaining variables in user-defined code

Your example is a bit confusing to me. You call $test->helper() with the same $test as $test->execute. In that case is $self in helper not equal to $self in execute?

Or do you mean that you want to call:

$test->execute( sub { print "in the local coderef\n"; helper(); } );

with

sub helper { print "in helper\n"; }

and still have access to $self in helper?

Have Fun

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 14:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found