| 1 | package Catmandu::SFX; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 3 | our $VERSION = '0.02'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use Catmandu::Sane; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 3 | ▶ | use Catmandu::Util qw(:is); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 3 | ▶ | use Moo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 3 | ▶ | use POSIX qw(strftime); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 6 | ▶ | sub parse_sfx_threshold { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_sfx_threshold: called CC=15 SCAR=30.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 6 | my ($self,$str) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 6 | my $res = { raw => $str , start => {} , end => {} , limit => {} , years => [] }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | # Parse the Available from part... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 6 | ▶ | if ($str =~ m{^Available\s+(.*)\.}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 4 | my $from = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 4 | ▶ | if (defined $from && $from =~ m{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $from and $from =~ /
(in|from)
\s+
(\d+)
(\s+volume:\s+(\S+))?
(\s+issue:\s+(\S+))?
(.*)
/x
MC/DC0%0/2
defined $from and $from =~ /
(in|from)
\s+
(\d+)
(\s+volume:\s+(\S+))?
(\s+issue:\s+(\S+))?
(.*)
/x
defined $from
$from =~ /
(in|from)
\s+
(\d+)
(\s+volume:\s+(\S+))?
(\s+issue:\s+(\S+))?
(.*)
/x
Truth table33%1/3
A and B
A= defined $fromB= $from =~ /
(in|from)
\s+
(\d+)
(\s+volume:\s+(\S+))?
(\s+issue:\s+(\S+))?
(.*)
/x
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | (in|from) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | \s+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | (\d+) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | (\s+volume:\s+(\S+))? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | (\s+issue:\s+(\S+))? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | (.*) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | }x) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 4 | $res->{start}->{year} = $2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 4 | ▶ | $res->{start}->{volume} = $4 if $3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 4 | ▶ | $res->{start}->{issue} = $6 if $5; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 4 | my $until = $7; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 4 | ▶ | if (defined $until && $until =~ m{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $until and $until =~ /
until
\s+
(\d+)
(\s+volume:\s+(\S+))?
(\s+issue:\s+(\S+))?
/x
MC/DC0%0/2
defined $until and $until =~ /
until
\s+
(\d+)
(\s+volume:\s+(\S+))?
(\s+issue:\s+(\S+))?
/x
defined $until
$until =~ /
until
\s+
(\d+)
(\s+volume:\s+(\S+))?
(\s+issue:\s+(\S+))?
/x
Truth table33%1/3
A and B
A= defined $untilB= $until =~ /
until
\s+
(\d+)
(\s+volume:\s+(\S+))?
(\s+issue:\s+(\S+))?
/x
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | until | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | \s+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | (\d+) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | (\s+volume:\s+(\S+))? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | (\s+issue:\s+(\S+))? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | }x) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | $res->{end}->{year} = $1 if $1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | ▶ | $res->{end}->{volume} = $3 if $3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | $res->{end}->{issue} = $5 if $5; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | # Parse the Most recent part... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 6 | ▶ | if ($str =~ m{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | Most | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | \s+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | recent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | \s+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | (\d+) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | \s+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | (year|month) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | \(s\) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | \s+ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | (not\s+)? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | available | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | \. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | }x) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 4 | $res->{limit}->{num} = $1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 4 | $res->{limit}->{type} = $2; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 4 | ▶ | $res->{limit}->{available} = $3 ? 0 : 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 6 | ▶ | if (exists $res->{end}->{year} || exists $res->{limit}->{num}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $res->{"end"}{"year"} or exists $res->{"limit"}{"num"}
MC/DC50%1/2
exists $res->{"end"}{"year"} or exists $res->{"limit"}{"num"}
exists $res->{"end"}{"year"}
exists $res->{"limit"}{"num"}
Truth table66%2/3
A or B
A= exists $res->{"end"}{"year"}B= exists $res->{"limit"}{"num"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 4 | $res->{is_running} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 2 | $res->{is_running} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 6 | $res->{years} = $self->parse_year_ranges($res); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 6 | $res->{human} = $self->parse_human_ranges($res); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 6 | $res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 6 | ▶ | sub parse_human_ranges { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_human_ranges: called CC=5 SCAR=16.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 6 | my ($self,$parsed) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 6 | my $years = $parsed->{years}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 6 | my @human = (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 6 | ▶ | if (is_array_ref($years) && @$years > 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
is_array_ref($years) and @$years > 0
MC/DC0%0/2
is_array_ref($years) and @$years > 0
is_array_ref($years)
@$years > 0
Truth table33%1/3
A and B
A= is_array_ref($years)B= @$years > 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 6 | push @human , $years->[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 6 | ▶ | push @human , $years->[-1] if @$years > 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 6 | ▶ | if ($parsed->{is_running} == 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 4 | return join(' - ', @human); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 2 | return shift(@human) . " - "; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 6 | ▶ | sub parse_year_ranges { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_year_ranges: called CC=10 SCAR=23.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 6 | my ($self,$parsed) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | # Calculate which years are available for users... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 6 | my $this_year = strftime("%Y", localtime); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 6 | my ($start_year,$end_year); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 6 | ▶ | $start_year = $parsed->{start}->{year} if exists $parsed->{start}->{year}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 6 | ▶ | $start_year //= $this_year; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$start_year //= $this_year
MC/DC0%0/2
$start_year //= $this_year
$start_year
$this_year
Truth table66%2/3
A //= B
A= $start_yearB= $this_year
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 6 | ▶ | $end_year = $parsed->{end}->{year} if exists $parsed->{end}->{year}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 6 | ▶ | $end_year //= $this_year; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$end_year //= $this_year
MC/DC0%0/2
$end_year //= $this_year
$end_year
$this_year
Truth table33%1/3
A //= B
A= $end_yearB= $this_year
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | # If most recent X years(s) are not available | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 6 | ▶ | if (exists $parsed->{limit} && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
exists $parsed->{"limit"} and $parsed->{"limit"}{"num"} and $parsed->{"limit"}{"type"} eq "year" and $parsed->{"limit"}{"available"} == 0
exists $parsed->{"limit"} and $parsed->{"limit"}{"num"} and $parsed->{"limit"}{"type"} eq "year"
exists $parsed->{"limit"} and $parsed->{"limit"}{"num"}
MC/DC75%3/4
exists $parsed->{"limit"} and $parsed->{"limit"}{"num"} and $parsed->{"limit"}{"type"} eq "year" and $parsed->{"limit"}{"available"} == 0
exists $parsed->{"limit"}
$parsed->{"limit"}{"num"}
$parsed->{"limit"}{"type"} eq "year"
$parsed->{"limit"}{"available"} == 0
Truth table80%4/5
A and B and C and D
A= exists $parsed->{"limit"}B= $parsed->{"limit"}{"num"}C= $parsed->{"limit"}{"type"} eq "year"D= $parsed->{"limit"}{"available"} == 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | $parsed->{limit}->{num} && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | $parsed->{limit}->{type} eq 'year' && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | $parsed->{limit}->{available} == 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 2 | $end_year -= $parsed->{limit}->{num} + 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 6 | ▶ | if ($start_year < $end_year) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 4 | return [ ($start_year .. $end_year) ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 2 | return [ ($end_year .. $start_year) ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 1 | ▶ | sub parse_sfx_year_range { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_sfx_year_range: called CC=8 SCAR=20.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 1 | my ($self, $years) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 1 | ▶ | return "" unless is_array_ref($years) && @$years > 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
is_array_ref($years) and @$years > 0
MC/DC0%0/2
is_array_ref($years) and @$years > 0
is_array_ref($years)
@$years > 0
Truth table33%1/3
A and B
A= is_array_ref($years)B= @$years > 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 1 | my $curryear = [localtime time]->[5] + 1900; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 1 | my %h; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 1 | foreach (@$years) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 6 | $h{$_} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 1 | my $start = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 1 | my $prev = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 1 | my $human = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 1 | foreach (sort { $a <=> $b } keys %h) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 6 | ▶ | if (! defined $start) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 1 | $start = $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | elsif ($_ == $prev + 1) { } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | elsif ($start == $prev) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 1 | $human .= "$start ; "; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 1 | $start = $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 1 | $human .= "$start - $prev ; "; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 1 | $start = $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 6 | $prev = $_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 1 | $human .= "$start - $prev"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 1 | return $human; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||