use strict; my $pattern = "A29 A*"; my (@lefthand,@righthand); while ( ) { chomp; my ($lhs,$rhs) = unpack ($pattern,$_); push (@lefthand,$lhs); push (@righthand,$rhs); } print "\nLEFTHAND STUFF:\n"; print join "\n", @lefthand; print "\nRIGHTHAND STUFF:\n"; print join "\n", @righthand; __DATA__ LHC RHC By deleting the initial You have removed the whitespace you are going whitespace that was to move what was in the in front of the left right hand column all hand column. This the way to the left. approach might be better than what you were trying. This is because If nothing else it is a new direction.