if ($word =~ m/(.*)\<(.*)\>/){ chomp; push @array,$1; } else { push @array,$word; }