for (1..10) { unless ($first) { $last = $_; $first = $last; } } print "$first..$last\n";