in reply to Dynamically changing the value of a passed variable into a sub

From my understanding of the question you want take $date_created and change the format, would this work for what you are asking:
unless ($date_created =~ s!^(\d{4})(\d{2})(\d{2})$!$2/$3/$1!) { warn " +Invalid Input: $date_created" }
I have also added the $ and ^ to the regex so as to make sure something like $date_created=SA123454 does not match. But just because it is an 8 digit number does not mean that it is a date, so other checks might be necassary as well.

Update: I think I misunderstood the question and thus think gjb has the answer you are looking for above.

-enlil