use strict;
my $t = 14;
print "$t\n";
$t = 15;
print "$t\n";
blah();
print "$t\n";
sub blah {
my $t = 42;
print "$t\n";
}
####
DB<1> w $t
DB<2> c
Watchpoint 0: $t changed:
old value: ''
new value: '14'
main::(dbt.pl:4): print "$t\n";
DB<2> c
14
Watchpoint 0: $t changed:
old value: '14'
new value: '15'
main::(dbt.pl:6): print "$t\n";
DB<2> c
15
Watchpoint 0: $t changed: <<<<< the bane of my existence
old value: '15'
new value: '42'
main::blah(dbt.pl:12): print "$t\n";
DB<2> c
42
Watchpoint 0: $t changed: <<<<< just more bane
old value: '42'
new value: '15'
main::(dbt.pl:8): print "$t\n";
DB<2> c
15
Watchpoint 0: $t changed:
old value: '15'
new value: ''
Debugged program terminated.
##
##
DB<1> w $t
DB<2> c
Watchpoint 0: $t changed:
old value: ''
new value: '14'
main::(dbt.pl:4): print "$t\n";
DB<2> W $t
DB<3> $z=\$t
DB<4> w $$z
DB<5> c
14
Watchpoint 0: $$z changed:
old value: '14'
new value: '15'
main::(dbt.pl:6): print "$t\n";
DB<5> c
15
42
15
Watchpoint 0: $$z changed:
old value: '15'
new value: ''
Debugged program terminated.