First of all: this does definetely not look like a first program. You have already done things lots of people need years to grok: strict, warnings, CGI.pm .

First hint: often it's just more beatiful to hard-code a list using qw//, not quting each element of the list...

my @members = qw/Algeria Indonesia .../;

Second: The HTML-generating functions of CGI.pm work differently. You must nest the functions like the resulting HTML.

print $query->td( { -style => 'width:600px' }, $query->p( '....' ) );

Avoid the use of globals like your $period variable (a lexical that works like global here): First, it's confusing, especially when you have a lexical $period within a sub and second: it's obfuscating anyways. Rather pass such things as parameters.

Finally you're inconsistent about the use of CGI.pm to generate HTML. A very personal note: please consider using XHTML.

--
http://fruiture.de

In reply to Re: Confessions of an Initiate: a first Perl program by fruiture
in thread Confessions of an Initiate: a first Perl program by mooseboy

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.