| 1 | package Pointy::Counter; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use 5.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | our (@EXPORT, @ISA); | |||||||||
| 7 | BEGIN | ||||||||||
| 8 | 4 | ▶ | { | ||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.1
| |||||||||||
| 9 | 4 | require Exporter; | |||||||||
| 10 | 4 | @ISA = qw/Exporter/; | |||||||||
| 11 | 4 | @EXPORT = qw/counter/; | |||||||||
| 12 | |||||||||||
| 13 | 4 | $Pointy::Counter::AUTHORITY = 'cpan:TOBYINK'; | |||||||||
| 14 | 4 | $Pointy::Counter::VERSION = '0.002'; | |||||||||
| 15 | |||||||||||
| 16 | 4 | ▶ | eval { require Object::AUTHORITY and import Object::AUTHORITY }; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | use overload | ||||||||||
| 20 | 26 | ▶ | '--' => sub { my ($self) = @_; $$self++ }, | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.1
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 23 | ▶ | '>' => sub { my ($self, $other) = @_; $$self < $other }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 22 | 20 | ▶ | '""' => sub { my ($self) = @_; $$self }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 0 | ▶ | '+0' => sub { my ($self) = @_; $$self }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 24 | 4 | fallback => 1, | |||||||||
| 25 | 4 | ; | |||||||||
| 26 | |||||||||||
| 27 | sub new | ||||||||||
| 28 | 5 | ▶ | { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 29 | 5 | my ($class, $initial) = @_; | |||||||||
| 30 | 5 | ▶ | $initial = 0 unless defined $initial; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 5 | bless \$initial, $class; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | sub counter | ||||||||||
| 35 | 4 | ▶ | { | ||||||||
|
Subroutine
counter: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 36 | 4 | __PACKAGE__->new(@_); | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | sub continue | ||||||||||
| 40 | 1 | ▶ | { | ||||||||
|
Subroutine
continue: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 41 | 1 | my ($self) = @_; | |||||||||
| 42 | 1 | --$$self; | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 8 | ▶ | sub value :lvalue | ||||||||
|
Subroutine
value: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 46 | { | ||||||||||
| 47 | 8 | my ($self) = shift; | |||||||||
| 48 | 8 | ▶ | $$self = shift if scalar @_; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | 8 | $$self; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 4 | __FILE__ | |||||||||
| 53 | __END__ | ||||||||||