Tie-Counter

 view release on metacpan or  search on metacpan

lib/Tie/Counter.pm  view on Meta::CPAN

use warnings;
no  warnings 'syntax';

our $VERSION = '2009110701';


sub TIESCALAR {
    my $class     =   shift;
    my $value     =   shift;  #  ?? 0;  # Would have been nice....
       $value     =   0 unless defined $value;
    bless \$value => $class;
}

sub FETCH     {
    ${+shift} ++;
}

sub STORE     {
    my $self  = shift;
    my $value = shift;
    $$self    = $value;



( run in 0.400 second using v1.01-cache-2.11-cpan-65fba6d93b7 )