7 our @ISA = qw(Tie::StdHash);
11 my %watched_variables;
14 my ($this, $key, $value) = @_;
16 if (substr($key, 0, 10) eq "Watchdog::") {
17 substr $key, 0, 10, "";
18 foreach $key (split m/[ ,]/, $key) {
19 $watched_variables{$key} = $value;
21 $main::lxdebug->_write("WATCH", "Starting to watch '$key' with current value '$this->{$key}'");
23 $main::lxdebug->_write("WATCH", "Stopping to watch '$key'");
30 if ($watched_variables{$key}
31 && ($this->{$key} ne $value)) {
32 my $subroutine = (caller 1)[3];
33 my ($self_filename, $self_line) = (caller)[1, 2];
34 $main::lxdebug->_write("WATCH",
35 "Value of '$key' changed from '$this->{$key}' to '$value' "
36 . "in ${subroutine} at ${self_filename}:${self_line}");
37 if ($watched_variables{$key} > 1) {
39 my ($dummy, $filename, $line);
41 while (($dummy, $filename, $line, $subroutine) = caller $level) {
42 $main::lxdebug->_write("WATCH", " ${subroutine} from ${filename}:${line}");
48 $this->{$key} = $value;
52 my ($this, $key) = @_;
54 if ($watched_variables{$key} && ($this->{$key} ne "")) {
55 my $subroutine = (caller 1)[3];
56 my ($self_filename, $self_line) = (caller)[1, 2];
57 $main::lxdebug->_write("WATCH",
58 "Value of '$key' changed from '$this->{$key}' to '' "
59 . "in ${subroutine} at ${self_filename}:${self_line}");
60 if ($watched_variables{$key} > 1) {
62 my ($dummy, $filename, $line);
64 while (($dummy, $filename, $line, $subroutine) = caller $level) {
65 $main::lxdebug->_write("WATCH", " ${subroutine} from ${filename}:${line}");