| 1 | package Parser::FIT::Simple; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use Parser::FIT; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 9 | 1 | my $class = shift; | |||||||||
| 10 | |||||||||||
| 11 | 1 | my $self = {}; | |||||||||
| 12 | |||||||||||
| 13 | 1 | bless($self, $class); | |||||||||
| 14 | |||||||||||
| 15 | 1 | return $self; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 1 | ▶ | sub parse { | ||||||||
|
Subroutine
parse: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 19 | 1 | my $self = shift; | |||||||||
| 20 | 1 | my $file = shift; | |||||||||
| 21 | |||||||||||
| 22 | 1 | my $result = {}; | |||||||||
| 23 | |||||||||||
| 24 | my $parser = Parser::FIT->new(on => { | ||||||||||
| 25 | 109 | ▶ | _any => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||||||||||
| 26 | 109 | my ($msgType, $msg) = (shift, shift); | |||||||||
| 27 | 109 | ▶ | if(!exists $result->{$msgType}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 7 | $result->{$msgType} = []; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 109 | push(@{$result->{$msgType}}, $msg); | |||||||||
| 32 | } | ||||||||||
| 33 | 1 | }); | |||||||||
| 34 | |||||||||||
| 35 | 1 | $parser->parse($file); | |||||||||
| 36 | |||||||||||
| 37 | 1 | return $result; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 1 | 1; | |||||||||
| 41 | |||||||||||
| 42 | __END__ | ||||||||||