In the documentation (perldoc CGI) for the CGI (not CGI::Application)
module, there is a section titled
THE DISTRIBUTIVE PROPERTY OF HTML SHORTCUTS
This section is probably what you are looking for. Specifically...
This is extremely useful for creating tables. For example:
print table({-border=>undef},
caption('When Should You Eat Your Vegetables?'),
Tr({-align=>CENTER,-valign=>TOP},
[
th(['Vegetable', 'Breakfast','Lunch','Dinner']),
td(['Tomatoes' , 'no', 'yes', 'yes']),
td(['Broccoli' , 'no', 'no', 'yes']),
td(['Onions' , 'yes','yes', 'yes'])
]
)
);
If you need to translate one structure into something passable as an array
ref, take a look at the documentation for the map() command (perldoc -f
map).
Brian
[EMAIL PROTECTED] on 01/25/2002 02:53:25 PM
To: [EMAIL PROTECTED]
cc:
bcc:
Subject: RE: [cgiapp] Need a help...
I knew that, I wanted to know if there is a way of doing this with
$q->table() or somthing similar.
Thanks for the help Brian!!
Bal.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 25, 2002 3:08 PM
To: [EMAIL PROTECTED]
Subject: Re: [cgiapp] Need a help...
I hit send too quickly.
At the end of your function, "return $output;".
[EMAIL PROTECTED] on 01/25/2002 01:54:31 PM
To: [EMAIL PROTECTED]
cc:
bcc:
Subject: Re: [cgiapp] Need a help...
Replace your "print" statements with '$output .= <<"_END_";'. For example,
print <<"_END_";
<TR>
_END_
;
would be replaced by
$output .= <<"_END_";
<TR>
_END_
;
See page 43 in the second edition of the "Camel book" (chapter 2, The Gory
Details, Here documents) for more information. Even though the book does
not say it, you can use a here document almost anywhere.
Good luck, and if you have not picked up the Camel book yet, I would
(again) recommend it.
Brian
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]