while(){ if ($_ =~ /(same_text\s=\s\d),((\s\S+){1,2})/gi){ ($junk,$ky)=split(/=/,$1); push(@{$hash{$ky}},$2); } }