display number month to string month in perl

by kalai 2008-12-19 12:39:44


my %month = (
'1'=>'January' ,
'2'=>'February' ,
'3'=>'March',
'4'=>'April' ,
'5'=>'May' ,
'6'=>'June' ,
'7'=>'July' ,
'8'=>'August' ,
'9'=>'September' ,
'10'=>'October' ,
'11'=>'November' ,
'12'=>'December' ,
);

$_ = '2008/12/19';
($year,$mon,$day) = m<^(d{4})/(dd?)/(dd?)>;
print $month{$mon};



RESULT:
December

Tagged in:

1321
like
0
dislike
0
mail
flag

You must LOGIN to add comments