Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using object oriented syntax throughout a script

Status
Not open for further replies.

rdyoll

Technical User
Aug 11, 2003
39
US
I'm curious to know if it is possible to write a script using 100% object oriented syntax. I know I can use the <<EOF or the regular print &quot;blah, blah&quot;; statements, but how would I use say:

print $q->header,
$q->start_html,
$q->table({-border=>&quot;1&quot;},
$q->Tr([
$q->td([
if (blah, blah) {
what I want printed in the table data area;
}
])])),
$q->end_html;

I hope I'm explaining myself correctly. Any help would be greatly appreciated.
 
Well I guess you're using CGI. And if I was trying to answer this I would go away and try it myself. If there is no hint or example of what you want in the documentation then I guess you can't do it. On the other hand have you looked at other modules such as HTML::Template.

With this module you basically make a form template very similar to an HTML form and then you call it in a separate perl script. It seems like extra work but it separates your HTML from your code and for some applications this is better than using CGI to do everything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top