while (scalar @array) #scalar not needed, but this is what is meant { print "@array\n"; shift (@array); }