Catmandu::Counter3pm
A base class for modules who need to count things
Usage
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;
Attributes
count
The current value of the counter.
Methods
inc_count()
inc_count(NUMBER)
Increment the counter.
dec_count()
dec_count(NUMBER)
Decrement the counter.
reset_count()
Reset the counter to zero.
Releases
6 releases since Debian 8 (Jessie); the text changed 5 times.