Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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
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 cooling their heels in the Monastery: (5)
As of 2014-08-21 05:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls