in reply to Re: Caller's Variables
in thread Caller's Variables
That is, lexical variables that don't share a scope are unreachable.Not strictly true since you can modify lexical variables with the help of PadWalker. Here's some code from the docs
Although you'd have to be quite a disturbed individual to use this sort of thing insub increment_my_x { my $h = peek_my (1); ${$h->{'$x'}}++; } my $x=5; increment_my_x; print $x; # prints 6
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Caller's Variables
by shotgunefx (Parson) on Jul 08, 2002 at 20:21 UTC |