wiz has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use CGI qw(:standard); my (%blocks, $date, $timeholder, $block, @timeholder, @event); get_block(); print header(), start_html("Block Order Script"), h1("The Next Block O +rder is: "); my @timer = localtime(time); my $day = $timer[7]; my $hour=$timer[2]; my $minute= $timer[1]; my $dotw =$timer[6]; if (($hour >= "14") && ($minute > "11") && ($dotw != "1") && ($dotw != + "7")) { $day++; }elsif ($dotw == "1"){ $day++; } elsif (($hour >= "14") && ($minute >"11") && ($dotw == "6")){ $day+=3; } elsif($dotw == "7") { $day+=2; } print p($blocks{$day}); print p($event[$day]); print end_html; sub get_block { open (BLOCK, "/home/signguy/public_html/DB_Files/block.db") or die "$! +"; my $r = 0; while ($date = <BLOCK>) { chomp ($date); $block = <BLOCK>; chomp ($block); $event[$r] = <BLOCK>; chomp ($event[$r]); $blocks{$date} = ($block); $r++; } close (BLOCK); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Hash and Array Printouts in CGI
by jeffa (Bishop) on Jul 13, 2001 at 03:13 UTC | |
|
Re: Hash and Array Printouts in CGI
by CheeseLord (Deacon) on Jul 13, 2001 at 05:11 UTC | |
|
Re: Hash and Array Printouts in CGI
by wiz (Scribe) on Jul 13, 2001 at 03:53 UTC | |
by HyperZonk (Friar) on Jul 13, 2001 at 03:55 UTC | |
|
Re: Hash and Array Printouts in CGI
by petral (Curate) on Jul 13, 2001 at 03:32 UTC | |
|
Re: Hash and Array Printouts in CGI
by HyperZonk (Friar) on Jul 13, 2001 at 03:42 UTC | |
|
Re: Hash and Array Printouts in CGI
by wiz (Scribe) on Jul 13, 2001 at 03:25 UTC |