| 1 | package App::prefixintsumcol; | ||||||||||
| 2 | 2 | $App::prefixintsumcol::VERSION = '0.0.1'; | |||||||||
| 3 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | ▶ | use Math::GMP (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | sub new | ||||||||||
| 9 | 1 | ▶ | { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 10 | 1 | my $class = shift; | |||||||||
| 11 | |||||||||||
| 12 | 1 | my $self = bless {}, $class; | |||||||||
| 13 | |||||||||||
| 14 | 1 | $self->_init(@_); | |||||||||
| 15 | |||||||||||
| 16 | 1 | return $self; | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | sub _init | ||||||||||
| 20 | 1 | ▶ | { | ||||||||
|
Subroutine
_init: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 1 | my ( $self, $args ) = @_; | |||||||||
| 22 | |||||||||||
| 23 | 1 | return; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | sub run | ||||||||||
| 27 | 1 | ▶ | { | ||||||||
|
Subroutine
run: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||
| 28 | 1 | my $s = Math::GMP->new('0'); | |||||||||
| 29 | |||||||||||
| 30 | 1 | ▶ | while ( my $l = <ARGV> ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | { | ||||||||||
| 32 | 3 | chomp $l; | |||||||||
| 33 | 3 | ▶ | if ( my ($diff) = ( $l =~ m#\A([0-9]+)(?:\s|\Z)# ) ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | { | ||||||||||
| 35 | 3 | printf( "%s\t%s\n", ( $s += Math::GMP->new($diff) ), $l ); | |||||||||
| 36 | } | ||||||||||
| 37 | else | ||||||||||
| 38 | { | ||||||||||
| 39 | 0 | die "Line '$l' at $. does not start with an integer number."; | |||||||||
| 40 | } | ||||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 1 | return; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | 2 | 1; | |||||||||
| 47 | |||||||||||
| 48 | __END__ | ||||||||||