I've set up a hash which contains information about individual column in a mySQL file. The hash contains the mySQL column name, the "plain text" column name, default column widths for tables, and the default param. Since there are hundreds of different mySQl columns, I don't want to create the CGI param unless that particular column is needed. When generating a report, the columns desired are entered into an array, that array is then stepped through, with each $_ acting as the key to the %hash, pulling all the relevant information as needed about any particular column. example
%sample = ( 'login' =>["Login", 75, qq|textfield('login')|], 'last' =>["Last Name", 75, qq|textfield('last')|], 'first' =>["First Name", 70, qq|textfield('first')|], 'address' =>["Address", 140, qq|textarea('address','',2,40)|] );
Thus to create a table of just 'last' and 'first', I could reference the correct element of the hash and retreive the correct column name, the default width, and the cgi param to pass in order to create the correct form element. Additionally, if I'm generating a report, all I would need to pull is the column name and size, etc.

I could replace the qq|textfield('xxxx')| with $q->textfield('xxx'), which does work, however, I don't want to generate all those cgi params unless they are needed.
--
Filmo the Klown


In reply to Re: Re: Passing scalars to CGI module by filmo
in thread Passing scalars to CGI module by filmo

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.