in reply to Re: print content in cgi and html
in thread print content in cgi and html

I have conditions in my html cgi output. How would I handle that?
if($condition) { print <<HTML Content-type: text/html <html><head>.....</head> <body bgcolor="white"> if($variable == 1) { print $anotherVariable; } </body> </html> HTML }

Replies are listed 'Best First'.
Re: Re: Re: print content in cgi and html
by barrd (Canon) on Sep 26, 2003 at 16:25 UTC
    Use multi HERE Documents like:

    if ($condition) { print <<HTML Content-type: text/html <html><head>.....</head> <body bgcolor="white"> ... blah blah HTML if ($variable == 1) { print $anotherVariable; } print <<HTML ... blah blah </body></html> HTML }

    Or as I mentioned before use HTML::Template, it can handle all that for you too... go on try it, you know you want to. ;)