in reply to Ternary operators: a hinderance, not a help
my $send_now_button = ( !$auth{SEND} ? '' : $status != 1 ? '' : $approved ? $send_now ? '' : qq( ...blah blah ... ) : $send_now ? '' : '' );
Yes, that's a real-life example, in production code, for a multi-million dollar corporation, although I cleaned it up a bit.
Personally, I like the ternary, as long as you don't go nuts with it. I only use it in assignments, and I don't nest them.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Ternary operators: a hinderance, not a help
by Zaxo (Archbishop) on Aug 09, 2005 at 19:35 UTC | |
|
Re^2: Ternary operators: a hinderance, not a help
by graff (Chancellor) on Aug 10, 2005 at 01:31 UTC |