- or download this
use warnings;
use strict;
...
my @times2;
for my $elmt (@times) {
- or download this
if (! @times1 || $elmt - $times1[-1] >= 10) {
push @times1, $elmt;
next;
}
- or download this
if (! @times2 || $elmt - $times2[-1] >= 10) {
push @times2, $elmt;
next;
}
- or download this
push @times1, $elmt;
}
- or download this
print "Times1: @times1\n";
print "Times2: @times2\n";
- or download this
Times1: 5 20 30 40 50 65 75 90
Times2: 10 25 45 55 80