in reply to A quick date swap from a string
foreach my $num (@tokens) { my $strBegin = uc substr($num, 0, 3); $date = $months{$strBegin} if exists $months{$strBegin}; } [download]
I don't know what data you're processing, but this method doesn't look reliable.