Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: If statements with CGI.pm tables

by mephit (Scribe)
on May 08, 2002 at 18:57 UTC ( [id://165134]=note: print w/replies, xml ) Need Help??


in reply to If statements with CGI.pm tables

print start_table({-border => '', -width => "100%"}), ( $foo ? Tr(td('foo is set'), td('foo is still set')) : Tr(td('foo is not set'), td('foo is still not set')) ), end_table;
That works. (I initially tried putting a bare block inside the print statement, but it looks like perl saw it as an anonymous hash, instead.) Or you can just put your conditional outside of any print statements:
print start_table({-border => '', -width => "100%"}); if ($foo) { print Tr(td('foo is set'), td('foo is set, still')); } else { print Tr(td('foo is not set'), td('foo is not set, yet')); } print end_table;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-19 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found