Devel::Carnivore 0.09 review
DownloadDevel::Carnivore is a Perl module to spy on your hashes (and objects). SYNOPSIS use Devel::Carnivore; sub new_attribut
|
|
Devel::Carnivore is a Perl module to spy on your hashes (and objects).
SYNOPSIS
use Devel::Carnivore;
sub new_attribute {
my %self : Watch("myName") = ();
bless %self, shift;
}
sub new_functional {
my $self = {};
watch $self, "myName";
bless $self
}
sub new_blessed {
my $self = {};
bless $self;
watch $self, "myName";
return $self;
}
sub new_scalar_attribute {
my $self : Watch("myName") = {};
bless $self
}
This module allows you to debug your hashes and, in particular, your objects based on hashes without using the perl debugger. There are several good reasons to do this. Among them:
1) You're too stupid to use the perl debugger (This is true for me)
2) You're building web applications and the perl debugger doesn't work very well in that environment
Obviously, this module does not provide you with a complete debugger. All it does is helping you keep track of the state changes which occur to your objects.
Output
By default all output is written to STDERR. You may change this behavior by assigning a valid output filehandle to $Devel::Carnivore::OUT.
Everytime the hash which is being watched by this module is assigned to, a message like this is created: > ProgLang: "cool" changed from "Java" to "Perl" at devel.pl line 30
So what does this tell you?
You have a Perl file named devel.pl. On line 30 your code changed the value of the key "cool" from "Java" to "Perl". In order, to identify this hash you optionally named it "ProgLang".
Requirements:
Perl
Devel::Carnivore 0.09 keywords