Task: Go through the original array and determine which of the new arrays it should go in. The decision is based on looking at what's at the end of @t1.
use strict;
use warnings;
my @times = (5, 10, 20, 25, 30, 40, 45, 50, 55, 65, 75, 80, 90);
my (@t1, @t2);
for (@times) {
push @{(defined $t1[-1] and $_ - 10 < $t1[-1]) ? \@t2 : \@t1}, $_;
}
print "@t1\n@t2\n";