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
Post a Comment