in reply to Hash and Array Printouts in CGI
#!/usr/bin/perl -w use strict; use CGI qw(:standard); my (%blocks, $date, $timeholder, $block, @timeholder); 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") and ($minute >="11")) || ($hour>= "15")) and ($d +otw != "0") and ($dotw != "6")) { $day++; }elsif ($dotw == "0"){ $day++; } elsif (((($hour >= "14") and ($minute >"11")) || ($hour>= "15")) and + ($dotw == "5")){ $day+=3; } elsif($dotw == "0") { $day+=2; } my ($blocks_ref,$events_ref) = get_block(); print p($blocks_ref->{$day}); print p($events_ref->[$day]); print end_html; sub get_block { my (%blocks,@event, $date); 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[$date] = <BLOCK>; chomp ($event[$date]); $blocks{$date} = ($block); $r++; } return (\%blocks,\@event); }
---------------------------- Wiz, The VooDoo Doll Head Master of 12:30 Productions ----------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Hash and Array Printouts in CGI
by HyperZonk (Friar) on Jul 13, 2001 at 03:55 UTC |