Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Conditional statements in CGI/Div

by blue_cowdawg (Prior)
on Jan 14, 2013 at 14:27 UTC ( #1013222=note: print w/ replies, xml ) Need Help??


in reply to Conditional statements in CGI/Div

Here's what you need:

$cgi->div({-id=>pagewrap}, ($index==0 ? $cgi->p("Hello") : $cgi->p() ) }
or something long those lines.


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg


Comment on Re: Conditional statements in CGI/Div
Download Code
Re^2: Conditional statements in CGI/Div
by slurch901 (Initiate) on Jan 27, 2013 at 23:18 UTC
    Thanks everyone for your input but the only way I could solve it was instead of using the DIV statement with brackets was to use the alternative.
    print $cgi->start_div({-id=>pagewrap}); if($index==0) {print "Hello";} print $cgi->end_div();

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2014-07-24 05:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (158 votes), past polls