I'm hideously new to the CGI module, and I've been trying to *read* through the docs. Not fun.

However, in between reading the docs, I try to slap a little code together, figuring that getting it on my hands will teach me better than getting it on my eyes (at first).

Now, I know how to do something to each instance of an array.

foreach $thing (@thingies) { something($thing) }

And I've seen how to generate a table from the CGI documentation. (And I won't duplicate it here since I'm working with the copied code before I try to write my own.)

The question: You can't interpolate whole subs, right? So if I do a print statement with a foreach inside it, that's not going to work. Should I slap it all into a hash, or is can I print pieces separately and put the table-stuff *around* the foreach, printing each little chunk of the array as three different table elements by passing them into a short, three-element array?

Is all of this going to make for a prohibitively long return time, considering that the array is going to have 1000+ elements?

Should I give up, and go back to my old job at Subway?

(The last is rhetorical. I know I should go back. I just don't want to.)

Apologies in advance for the time this wastes, and here's hoping I have better questions soon enough.


In reply to Yet Another Stupid CGI Question by chaoticset

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.