#!/usr/local/bin/perl4 # # copyright meng weng wong # freely distributable under the terms of the gnu public license # version 2.0 # this perl program will do basically the same thing as # post-query, only it's written in perl, not hexadecimal. # see http://www.seas.upenn.edu/~mengwong/forms/ ################################################## initialization # set this to your cgi-bin directory push(@INC,"/usr/local/etc/httpd/cgi-bin"); require 'cgi-lib.pl'; local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = gmtime; local($mname) = ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")[$mon]; local($dname) = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")[$wday]; #default date -- Current Month and Year ################################################## get input &ReadParse; print &PrintHeader; print <<"header"; Generic Calendar

Generic Calendar

header # $month = $mon+1; $year = $year + 100; $cyr = $year; # print "

Today is $dname, $mname\. $mday $year -- at $hour : $min GMT

\n"; print "


You Requested:

\n"; print &PrintVariablesShort(%in); $month = (substr($in[0] ,6,2)); $year = (substr($in[1],5,4)); print "


\n"; print "
\n";                      
#                         
#                                 
if ($month == 0) {$month = "";}   
if ($month != "") { print "

";} # open(CAL, "cal $month $year |"); while () { if ($month != "") {print "\n\t";} if ($month == $mon+1 && $cyr == $year) {s/\s$mday\s/*$mday*/;} print; } # if ($month != "") { print "

";} print "
\n"; print "

Notes

\n It is possible to extend this program by \n"; print "using the Unix (calendar, finger, etc.) commands. This page was an \n"; print " experiment to see what could be done using Perl.\n"; print "

Back to previous page.\n";