perl - Ways to get rid of empty if-statements? -


to me code how think of problem want solve

if ($b eq "" && $ok) {  } elsif ($b eq "" && !$ok) {     print "error1\n";  } else {     print "error2\n"; } 

but not pretty suppose having empty if-statement.

are there ways avoid this?

you need change logic want

if($b eq "" && !$ok){     print "error1\n"; }elsif( !$ok || $b ne ""){     print "error2\n"; } 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -