use warnings; use strict; my @c2; while () { my @cols = split; push @c2, $cols[1]; print "$cols[0]\n"; } print "$_\n" for @c2; __DATA__ a f b g c h d i e j