T
Tomasz Chmielewski
Although an empty "if" statement is technically OK in Perl, it doesn't
look very nice (and in some languages is even forbidden).
Let's suppose we have a code like:
if ($a == 1 && $b == 2) {
# Essentially an empty "if" statement
} else {
print "We're here only if a is not 1 and b is not 2!\n";
}
What would be a good way to get rid of this empty "if" statement?
Or is it OK to have it?
look very nice (and in some languages is even forbidden).
Let's suppose we have a code like:
if ($a == 1 && $b == 2) {
# Essentially an empty "if" statement
} else {
print "We're here only if a is not 1 and b is not 2!\n";
}
What would be a good way to get rid of this empty "if" statement?
Or is it OK to have it?