If you know what the unexpected value is, you can set the watch expression to check the value is not the unexpected one, so it will stay true even for a non-existent value.
w $hash{key} ne "unexpected"
Note that if the value is changed on the last line of a subroutine, the debugger won't show it, instead it will notice the change the next time you enter the scope.
Example:
#!/usr/bin/perl
use warnings;
use strict;
use feature qw{ say };
{ my %hash;
sub set {
%hash = (a => 12, b => 14);
}
sub get {
my ($key) = @_;
return $hash{$key}
}
sub change {
$hash{b} = 'Boo';
}
}
set();
say get('b');
change();
say get('b');
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
|