my %res; ... ... for my $fullString (however they are obtained) { $res{$fullString} ||= fieldParse( $fullString, etc. ); etc... }