Even though the indenting is much improved in this second example, I have to tell you that it still doesn't compile. Here's what I see with v5.14.3:

$ perl -cw 1126889.pl Unquoted string "case" may clash with future reserved word at 1126889. +pl line 12. String found where operator expected at 1126889.pl line 12, near "case + "EMEA"" (Do you need to predeclare case?) Unquoted string "case" may clash with future reserved word at 1126889. +pl line 13. String found where operator expected at 1126889.pl line 13, near "case + "APAC"" (Do you need to predeclare case?) "my" variable $q masks earlier declaration in same statement at 112688 +9.pl line 23. "my" variable $q masks earlier declaration in same scope at 1126889.pl + line 24. "my" variable $tablecontent masks earlier declaration in same scope at + 1126889.pl line 25. syntax error at 1126889.pl line 11, near "){" syntax error at 1126889.pl line 12, near "}->" syntax error at 1126889.pl line 12, near "+=" syntax error at 1126889.pl line 12, near "1}" syntax error at 1126889.pl line 13, near "1}" syntax error at 1126889.pl line 36, near "}" 1126889.pl had compilation errors.

Start by fixing the syntax errors and (as already suggested above) replacing select and case with something else. As you say you are a beginner try using something simple and intuitive such as

if ('EMEA' eq $filename || 'APAC' eq $filename) { $res{$date}{$hour}->{PEAK} += $peak; $flag = 1; } else { print "previous case not true"; }

instead. Note that this is not to suggest that $res{$date}{$hour}->{PEAK} += $peak; is the correct statement at that point but that's one step farther down the line. Try compiling the code samples before you post them. If you can post code which compiles then we'll at least have some idea where you are headed.


In reply to Re^3: Perl help with html cgi table by hippo
in thread Perl help with html cgi table by vkknava

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.