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 ];
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Two simple code style advice questions
by blue_cowdawg (Monsignor) on Jan 16, 2013 at 14:50 UTC | |
by runrig (Abbot) on Jan 16, 2013 at 18:53 UTC | |
by BrowserUk (Patriarch) on Jan 16, 2013 at 15:33 UTC | |
by Anonymous Monk on Jan 16, 2013 at 15:01 UTC |