With edits:
#!/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); }

I'm running the script here and I'm running this DB file

---------------------------- Wiz, The VooDoo Doll Head Master of 12:30 Productions ----------------------------

In reply to Re: Hash and Array Printouts in CGI by wiz
in thread Hash and Array Printouts in CGI by wiz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.