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

Re: Can you override lexically scoped variables when sub-classing a module.

by tobyink (Abbot)
on Oct 11, 2012 at 20:07 UTC ( #998529=note: print w/ replies, xml ) Need Help??


in reply to Can you override lexically scoped variables when sub-classing a module.

Not really, no. That's kind of the point of lexical variables. They can't be accessed from outside their scope, so they are immune to "spooky action at a distance".

It's a bit of a hack, but you might have some luck with PadWalker's set_closed_over.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: Can you override lexically scoped variables when sub-classing a module.
Download Code
Replies are listed 'Best First'.
Re^2: Can you override lexically scoped variables when sub-classing a module.
by learnedbyerror (Beadle) on Oct 11, 2012 at 21:53 UTC

    Thanks, I'll take a look at it. I had looked at Padwalker earlier but didn't get deep enough with it to figure out how to apply it to the module in question

    lbe

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2015-07-28 18:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls