| 1 | package Perl::Analysis::Static::Collector; | ||
| 2 | { | ||
| 3 | 4 | $Perl::Analysis::Static::Collector::VERSION = '0.004'; # TRIAL | |
| 4 | } | ||
| 5 | |||
| 6 | # ABSTRACT: collects answers to questions about a Perl documents | ||
| 7 | |||
| 8 | |||
| 9 | 4 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 4 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 4 | ▶ | use English qw( -no_match_vars ); # Avoids regex performance penalty |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | # with the help of Moose::Meta::Attribute::Native::Trait::Hash | ||
| 14 | has 'answers' => ( | ||
| 15 | traits => ['Hash'], | ||
| 16 | is => 'ro', | ||
| 17 | isa => 'HashRef', | ||
| 18 | 1 | ▶ | default => sub { {} }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 19 | 4 | handles => { | |
| 20 | set_answer => 'set', | ||
| 21 | get_answer => 'get', | ||
| 22 | has_no_answers => 'is_empty', | ||
| 23 | num_answers => 'count', | ||
| 24 | delete_answers => 'delete', | ||
| 25 | answer_pairs => 'kv', | ||
| 26 | filenames => 'keys' | ||
| 27 | } | ||
| 28 | ); | ||
| 29 | |||
| 30 | 4 | 1; | |
| 31 | |||
| 32 | __END__ | ||