everysecond.pl (264B)
1 #!/usr/bin/env perl 2 3 # give every second file 4 5 use strict; 6 use warnings; 7 8 my $start = shift; 9 my $end = shift; 10 11 while ($ARGV[0] ne $start) { 12 shift; 13 } 14 15 foreach my $i (0..$#ARGV) { 16 if ($i % 2 == 0) { 17 print(" $ARGV[$i]"); 18 } 19 if ($ARGV[$i] eq $end) { 20 last; 21 } 22 }