separating substitutions from an embedded perl in a ksh script

I have a large ksh script which had an embedded perl invocation to do a character replace... to fix a date in a large flat file. I know the script is inefficient, but I wanted to just improve the logic a bit rather than have to install new scripts etc. Anyway, the file has records that if start with the character "5" may need to have the date