about X command (display variables) in perl debugger
debugging, perl
Solution
The `X` command prints current package variables, e.g. declared as `our`. For lexical scope variables use `x` or `y` (needs `PadWalker` module installed) commands.
Problem
I am wondering how the big `X` command works in Perl debugger. So I have the following silly.pl script: ``` #!/usr/bin/perl -w use strict; my $var1 = 99; print "$var1\n"; ``` I run `perl -d silly.pl`, and step to the 4th line. There I type in the debugger: ``` X var1 ``` But nothing shows up. How should I use `X` to display the value of `var1`? (If I remove `use strict;` and don't use `my`, then I can get `X var1` working, but that seems not a solution.) With Many Thanks!