Catmandu::Counter - A Base class for modules who need to count things
package MyPackage; use Moo; with 'Catmandu::Counter'; sub calculate { my ($self) = @_; $self->inc_count; #...do stuff } package main; my $x = MyPackage->new; $x->calculate; $x->calculate; $x->calculate; print "Executed calculate %d times\n" , $x->count;
The current value of the counter.
Increment the counter.
Decrement the counter.
Reset the counter to zero.
Catmandu::Exporter
To install Catmandu, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu
CPAN shell
perl -MCPAN -e shell install Catmandu
For more information on module installation, please visit the detailed CPAN module installation guide.