szabgab has asked for the wisdom of the Perl Monks concerning the following question:
and the output:use strict; use warnings; use Devel::Carnivore; my $h; { my %h : Watch('%h'); $h{fname} = "Foo"; $h = \%h; } $h->{lname} = 'Bar'; unwatch $h; $h->{email} = 'foo@bar.com';
I have several comments: - When we start and stop watching I would like to see the name we assigned to the variable, better yet I'd like to see the real variable name. I would like to be able to control the watching from the outside world. e.g. in .carnivore I would like to say something like script.pl:37:watch %h; so I can run perl -d:Carnivore script.pl and %h will be watched from line 37 of the script.pl file Any idea if I can do this with another module? Maybe with the debugger?$perl carnivore.pl # variable is now under observation > %h: "fname" changed from "" to "Foo" at carnivore.pl line 10 > %h: "lname" changed from "" to "Bar" at carnivore.pl line 13 # mission completed
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: debugging: tracing changes to hashes
by shmem (Chancellor) on Nov 20, 2006 at 09:32 UTC | |
|
Automating the debugger with Devel::Carnivore
by pemungkah (Priest) on Nov 20, 2006 at 21:30 UTC |