in reply to empty 'else' block
It is a bad idea to put a last there.
Actually I sometime intentionally add blank else blocks in my code, simply to tell myself that, "I DID think about whether anything need to be done in the else branch, but really nothing need to be done here, I didn't foget".
To do that, simply leave it blank, or put a ; there.
use strict; use warnings; my $var; if ($var) { print $var; } else { ; } print "Hello World!";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: empty 'else' block
by FoxtrotUniform (Prior) on Nov 20, 2004 at 08:26 UTC |