in reply to Read And modify a series
my $a; $a = unshift(@array); while ($a == 1) $a = unshift(@array); if (defined($a)) unshift @array, $a; [download]
The first two unshifts should be shifts. You've been advised plenty of times to test code before posting; the very least you could do is proofread it.