-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Derek Goto <dg***@burntmail.com> wrote in
news:z9********************@ilhawaii.net:
I was running the perl debugger with arguments "-d -e 1" to test a small
program. When I assigned a value to the variable $foo, I could use it
fine, but when I qualified $bar with my, it remained undefined. Same
with local. Why is this? Does the debugger operate in a different scope
than main? If so, shouldn't I be able to access those values anyway? I
could access the value of $bar from the debugger when it was assigned
within in a script, but I couldn't successfully modify it. What's going
on here?
It's a limitation inherent in the debugger.
Each expression you enter at the debugger prompt is evaluated in its own
scope. When the expression is finished, the scope goes away. Your
assignment to "my $bar" works, but at the end of the scope $bar goes away,
and when you next type "p $bar" or "x $bar", it's not there any more.
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP0ndXGPeouIeTNHoEQKkKQCgzYi+ib0msMI/h4p7uLRW7QMdBhUAn1H+
YHV9TXERaOGVzxlbdLX6gQIb
=wA5Q
-----END PGP SIGNATURE-----