in reply to debugger watchpoint behavior
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');
|
---|