#!/usr/local/bin/perl #File:calendar4.pl use CGI; $CAL='/usr/bin/cal'; @years=(1990..2010); $query = new CGI; #Set the year to the query, otherwise the current year if($query->param('year')){ $year=$query->param('year'); }else { chop($year=`date +%Y`); } # Print the header and the top of the document print $query->header; print $query->start_html('Calendar'); print "
";
# Submit button
print $query->submit(-label=>'Make Calendar');
# end the form
print $query->end_form();
# ------------------- PRINT THE CALENDAR -------------------
unless ($year=~/^\d{4}$/) {
print "ERRORYear must be exactly four digits\n";
exit 0;
}
$extra_switches = '-j' if $query->param('julian');
chop($calendar_text=`$CAL $extra_switches $year`);
print <
Welcome Page
END
;
print $query->end_html();