I need to have a script where the date will be entered using numbers and forward slashes. The month and day numbers can be entered using one or two digits, and the year number can be entered using either two or four digits. The date should be displayed, for example, xx/xx/xx as xxxx x, xxxx. I also need the 20 added to the year if it is displayed as xx.
I have started the script but having trouble with the breaking apart the date and adding the 20. I have tried several different ways, but nothing is coming out correctly. Can anyone help me? Many thanks!!!
#!/usr/bin/perl
#date.cgi - converts a numeric date to a string
use CGI qw(:standard -debug);
use strict;
#declare variables
my ($date, $month, $day, $year);
my @months = "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
#assign input item to variable
$date = param('Date');
#break date apart
#display date
print "<HTML><HEAD><TITLE>Date</TITLE></HEAD>\n";
print "<BODY>\n";
print "Date: $date\n";
print "</BODY></HTML>\n";