[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Net. Nav., HTML, & Perl...



HELP!!!

Here is my problem:
I am brand new at Perl.  I have a Mac Performa 6400, Netscape Nav. 3.0,
& MacPerl 5.  I want to make a webpage for my site that combines HTML,
Perl, and JavaScript.  I want to test the pages out, however, before I
upload them to my site.  I can do this by viewing HTML & JavaScript file
using the Open File command in NN.  I tested this program that I found
in Perl 5 for Dummies and it just displays the cgi's written code.

Page 1 (HTML)

<HTML><HEAD>
<TITLE>Time</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">

Which time zone do you want to see the time for?
<BR>
<a href="cgi-bin/thetime.cgi?pacific">Pacific</a>?
<BR>
<a href="cgi-bin/thetime.cgi?central">Central</a>?
<BR>
<a href="cgi-bin/thetime.cgi?eastern">Eastern</a>?

</BODY>
</HTML>

Page 2 (Here's the problem)

#!perl -w

$TheZone = "Pacific";
if ($DesiredTimeZone eq 'central') {
	@TimeArr = localtime(time + 3600);
	$TheZone = "Central";
}
elseif($DesiredTimeZone eq 'eastern') {
	@TimeArr = localtime(time + 7200);
	$TheZone = "Eastern";
}
$Hour = $TimeArr[2];
$Minute = $TimeArr[1];
$TimeString = "$Hour:$Minute";
print <<"EndOfStuff"
Content-Type: text/html

<html><head><title>At the tone...</title></head><body>
In the <b>$TheZone</b> time zone, it is now $TimeString.
</body></html>
EndOfStuff


When run page 2 is printed as above.  Can someone please help?

Dakota Duff

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch