in reply to If/else problems

Your code is a good example of why "use strict;" is a good thing. I would recommend you adding it to all of your code, it will help you debug it. Here is your code fixed... see if you can see the differences:
#!/usr/bin/perl use strict; #$myname="Merlin"; my $DEBUG = 0; # my added here my $timediff = 0; # ? my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime ( +time + ($timediff * 3600)); print "$mon $hour, $mday, $mon, $year, $wday\n" if $DEBUG == 1; my @months = ('01','02','03','04','05','06','07','08','09','10','11',' +12'); my $month = $months[$mon]; print "Content-type: text/html\n\n"; if ($month eq '11'){ # use 'eq' to compare strings Nov eq '10' btw undef $/; open (FILE, 'hours.txt'); print <FILE>; close FILE; }

1) Comment your code
2) Place debug print statements in, or learn the debugger
3) use strict;
4) use warnings; until you know when you don't want it