------------------------------------------------------------------------------- ********** July 19th testLib.cgi PERL code ********** ------------------------------------------------------------------------------- #!/usr/bin/perl -w require "myCGI.lib"; print "Content-type: text/html \n\n"; print &first_html("July 19th page"), &ruler, heading(2, "\nUNI Panthers rock!\n"), &ruler, heading(3, "Jurassic Park III --- Day # II"), &ruler, heading("myCGI.lib functions are COOL!"), &ruler, heading( 2, qq( See the myCGI.lib and testLib.cgi PERL script code\n ) ), last_html(); ------------------------------------------------------------------------------- ********** July 19th myCGI.lib library code ********** ------------------------------------------------------------------------------- require "guestBook.lib"; # Created on Thursday 07/19/2001 during lab. # myCGI.lib has first_html(), last_html(), ruler() and heading() # printHeader() was added on July 22nd. sub printHeader { print "Content-type: text/html\n\n"; } sub first_html { @a = &rgbValue; $st = "\n$_[0]\n" . qq( \n ) . "

$_[0]

\n"; return $st; } sub last_html { return "\n\n\n"; } sub ruler { return "\n
\n"; } sub center { return "\nCENTER>\n $_ \n\n"; } sub heading { if ($_[0] >= 1 && $_[0] <= 5) { $n = shift (@_); } else { $n = 1; #

is the default heading style } $h = shift (@_); if (pop @_ eq "center") { return "\n
\n $h \n\n
\n"; } else { return "\n $h \n \n"; } } 1;