W
wlcna
I have a program I was running through the debugger that had a usage
like this (this is not the code but similar):
1: my $str = "hello there yes i am here";
2: $str =~ /([a-z]*)s/;
3: $yes = $1;
So, I'm running this in the debugger to check things out, make sure it's
working as I expect, and the debugger when I get to line 3 tells me that
$1 is "undef", and past line 3 it tells me that $yes did not receive any
value, it's "undef" as well.
I run this same program *NOT IN THE DEBUGGER* and everything is normal,
and I check by doing old-fashioned print statements. $yes is "yes" as
expected.
I've noticed problems before with viewing regular expression variables
in teh debugger.
I now assume that regular expressions and the debugger just don't mix
but prior to tonight I NEVER IMAGINED that something like my $yes
variable above would also not show the correct value in the debugger. I
had assumed the special regex variables scope meant if I tried to print
them directly from the debugger prompt, (i.e. p $1 or p $&) that
wouldn't work, but of course I thought running the program from inside
the debugger and watching its variables get set should still work
properly.
But now I don't even think that works. So what am I missing?
Thanks for any info!
like this (this is not the code but similar):
1: my $str = "hello there yes i am here";
2: $str =~ /([a-z]*)s/;
3: $yes = $1;
So, I'm running this in the debugger to check things out, make sure it's
working as I expect, and the debugger when I get to line 3 tells me that
$1 is "undef", and past line 3 it tells me that $yes did not receive any
value, it's "undef" as well.
I run this same program *NOT IN THE DEBUGGER* and everything is normal,
and I check by doing old-fashioned print statements. $yes is "yes" as
expected.
I've noticed problems before with viewing regular expression variables
in teh debugger.
I now assume that regular expressions and the debugger just don't mix
but prior to tonight I NEVER IMAGINED that something like my $yes
variable above would also not show the correct value in the debugger. I
had assumed the special regex variables scope meant if I tried to print
them directly from the debugger prompt, (i.e. p $1 or p $&) that
wouldn't work, but of course I thought running the program from inside
the debugger and watching its variables get set should still work
properly.
But now I don't even think that works. So what am I missing?
Thanks for any info!