Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Passing scalars to CGI module

by thabenksta (Pilgrim)
on Apr 14, 2001 at 01:37 UTC ( [id://72495]=note: print w/replies, xml ) Need Help??


in reply to Passing scalars to CGI module

May I ask why you are trying to do this?

There might be a better way to do what your trying to accomplish.

my $name = 'Ben Kittrell'; $name=~s/^(.+)\s(.).+$/\L$1$2/g; my $nick = 'tha' . $name . 'sta';

Replies are listed 'Best First'.
Re: Re: Passing scalars to CGI module
by filmo (Scribe) on Apr 14, 2001 at 02:19 UTC
    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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://72495]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-18 04:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found