my @a; $a[ $_ ] = chop $buffer for length($buffer)-1 .. 0; #### my @a; $a[ -$_ ] = chop $buffer for 1..length($buffer);