for (@yourarray) { chomp; # maybe my @ary = split / /, $_; for (0..1) { pop @ary; } print "@ary\n"; }