in reply to Final date conversion happiness script

Good work, it's been a pleasure seeing you develop this. Now the assignment is in, I'll show you how I'd do it. The basic principle I'll use is to get the input into some fixed order as soon as possible.

You could simplify it a bit by making split more ambitious, splitting on either whitespace or '/', my @dateparts = split '/|\s+', $date; Now decide if we have a named month second (08 Apr 1984), and reorder if so, @dateparts[0,1] = @dateparts[1,0] if $dateparts[1] =~ /^[A-Z]/; Lets collect the year logic in one place,

$dateparts[2] += ($dateparts[2] > 99) ? 0 : ($dateparts[2] > 9) ? 1900 : 2000;
Now sanity check the month exists $months{$dateparts[0]} or die 'Bad Month!'; It would be good to check the day against the number of days in the month - an exercise for you. Don't forget leap years ;-) We now have put the dateparts array in a set format and we can do what we like with it,
print $months{$dateparts[0]}, ' ', 0+$dateparts[1], ', ', dateparts[2];
For real work, I'd shove the numerical forms into a localtime-like array and call POSIX::strftime() on it for string formatting.

After Compline,
Zaxo