Re: script problem

by "Octavian Rasnita" <orasnita(at)home.ro>

 Date:  Tue, 7 Jan 2003 09:52:58 +0200
 To:  <hwg-techniques(at)hwg.org>,
"Michael Muehlendorf" <haoka(at)wi.tds.net>
 References:  tds
  todo: View Thread, Original
Hi, here is the script you need:

#!/usr/bin/perl

my $next_month;
my @months = qw(January February March April May June July August September
October November December);

my ($sec, $min, $hour, $mday, $mon, $year) = localtime(time());

$mon == 11 ? $next_month = $months[0] : $next_month = $months[$mon+1];

print "Content-type: text/html\n\n";
print "The next month is $next_month";


Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: orasnita(at)home.ro

----- Original Message -----
From: "Michael Muehlendorf" <haoka(at)wi.tds.net>
To: <hwg-techniques(at)hwg.org>
Sent: Tuesday, January 07, 2003 4:15 AM
Subject: script problem


This is a cross-post:

Hello List -

I have a script on my site that prints the name of the month that follows
the current month. For some reason, it has stopped giving output. I am
pasting in the code below, and perhaps some of you perl gurus could steer
me in the right direction to find/fix the error? Otherwise, can someone
tell me how to accomplish the same thing with PHP? (Or can you mix
server-side includes and PHP on the same XHTML document?)
_________________________________________________________
#!/usr/bin/perl

@Months = ("January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December");

$currmon = (localtime)[4];
$currmon == 11? $nextmon = 0: $nextmon = $currmon + 1;

print "Content-type: text/html\n\n";

print "<.b>$Months[$nextmon]<./b>\n";
_________________________________________________________

TIA and happy HTMLing,

Mike

Michael Jon Muehlendorf
Scenic Bluffs Webcrafters
http://www.scenic-bluffs.com/

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA