- or download this
use strict;
use warnings;
...
splice(@tmp, $_, 0, 'N') for reverse @positions;
print(join(',', @tmp), "\n");
}
- or download this
while (my (@positions) = $i->()) {
my @tmp;
...
push @tmp, @arr[$cur..$#arr];
print(join(',', @tmp), "\n");
}
- or download this
while (my (@positions) = $i->()) {
my $sep = '';
...
print($sep, $arr[$cur++]) while $cur < @arr;
print("\n");
}