http://www.perlmonks.org?node_id=1013585


in reply to Re: Two simple code style advice questions
in thread Two simple code style advice questions

OK defined as 0? Yuck!

That's as bad as defining TRUE as 0.

It would be far clearer as:

use constant NOERROR => 0; my $errstr = ( $case != NOERROR ? $msg[$case] : "" );

Though I'd skip that conditional statement completely and embed the logic in the data:

$msg[ 0 ] = ''; ... my $errstr = $msg[ $case ];

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.