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.