Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-28 18:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found