Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: perl syntax help for ternary operator

by Corion (Patriarch)
on Oct 09, 2014 at 07:47 UTC ( [id://1103266]=note: print w/replies, xml ) Need Help??


in reply to perl syntax help for ternary operator

You change the code that creates the HTML string to set the value outside of the interpolation:

my %descriptions= ( 'level3' => 'level3 stage', 'level2' => 'level2 stage', 'level1' => 'level1 stage', ); my $visual= $decsriptions{ $string } || 'Edit'; ... print "<td align=center>&nbsp;$visual</td>

Maybe it would be a good time now to look at templating systems.

Log In?
Username:
Password:

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

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

    No recent polls found