in reply to RegEx problem

Try out the attached example, first. When I say (.{4}), Perl takes it as: to match 4 of any characters (except newlines), and store in $1. When you said ({.4}), Perl took it as: literally match {.4}, and store in $1.

Another thing is, you regexp is a little bit loose, in this case, better to use \d instead of '.'. Think about this, what if the date being passed in is malformatted?
{$str = "1234{.4}"; $str =~ m/(.{4})/; print $1, "\n";#print 1234 $str =~ m/({.4})/; print $1, "\n";#print {.4}