#!perl use strict; my @months = qw( -- January February March April May June July August September October November December); my @dayends = qw( -- st nd rd th th th th th th th th th th th th th th th th th st nd rd th th th th th th th st); while(my $date = ) { chomp $date; $date =~ s!(\d{1,2})(\/|\-)(\d{1,2})(\/|\-)(\d{2,4})! $1 . $dayends[$1] . ' ' . $months[$3] . ' ' . $5 !eg; print $date, $/; } __DATA__ 3/3/2002 5/11/2002 31-07-2002 1-4-02 21-2-02 31-12-2002