my %correct; while (){ ::Read data in the form $dest_hash_name, $text, [other info...] $correct{$text} = Generate_hashref($dest_hash_name); }