unless (...) is the equivalent of if (not (...)) - it only simplifies your code if it makes it more readable. For example, you might find next LINE unless format_is_ok($line); more readable than next LINE if !format_is_ok($line);. When in doubt, stick with if. Also, unless is a conditional statement like if, not a "loop".
In reply to Re: Simplify code in Perl with "unless" loop
by Anonymous Monk
in thread Simplify code in Perl with "unless" condition
by Chaoui05
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |