Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Newbie to PERL debugger

by ISAI student (Scribe)
on Oct 05, 2011 at 15:09 UTC ( #929825=perlquestion: print w/ replies, xml ) Need Help??
ISAI student has asked for the wisdom of the Perl Monks concerning the following question:

Hello all. I am trying to get the debugger to print out variable values based on pattern and fail miseraly. See sample code below:

#!/usr/bin/perl -w use strict; my $m=0; my $popop=1; $popop=2; __END__

I run the debugger, do b 5, and can't find the vraiable $popop. See code below:

perl -d ./converCshelltsetenvToSkill.pl Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(./converCshelltsetenvToSkill.pl:3): 3: my $m=0; DB<1> b 5 DB<2> c main::(./converCshelltsetenvToSkill.pl:5): 5: $popop=2; 6: __END__ DB<2> X *popo* DB<3>

What am I doing wrong here?

Comment on Newbie to PERL debugger
Select or Download Code
Re: Newbie to PERL debugger
by runrig (Abbot) on Oct 05, 2011 at 15:19 UTC

      No luck there either.

      DB<6> X ~popo DB<7>
        Ah, X and V are only for package variables. They will not work for lexical (my) variables. You can display specific lexical variables with "x", but not by regex. It does say "y" should work for lexicals like V and X, if you have PadWalker installed (which I don't).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-09-24 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (244 votes), past polls