Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Debugger question

Reply
Thread Tools

Debugger question

 
 
Derek Goto
Guest
Posts: n/a
 
      08-25-2003
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?

 
Reply With Quote
 
 
 
 
Eric J. Roode
Guest
Posts: n/a
 
      08-25-2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Derek Goto <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> 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-----
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help getting a debugger going for IE - any free debugger aflat362 Javascript 7 12-07-2006 10:51 PM
Neither IE-Debugger or Mozilla/Venkman debugger can step through dynamically added code? Robert Oschler Javascript 1 09-05-2005 07:17 AM
asp.net debugger question Philip Townsend ASP .Net 2 12-05-2003 04:18 PM
Debugger question Derek Goto Perl 1 08-25-2003 09:56 AM
NetBeans Debugger Question Richard C. Eberhardt Java 0 07-18-2003 11:14 PM



Advertisments