We don't bite newbies here... much | |
PerlMonks |
Re^5: My coding guidelinesby Aristotle (Chancellor) |
on Nov 30, 2002 at 18:18 UTC ( [id://216671]=note: print w/replies, xml ) | Need Help?? |
print "$pattern not found in $file\n" unless $found;I use unless when I expect that the print will be executed most of the time - unless the condition happens to be true. In the quoted case, I'd probably use if not, as the if highlights the fact that the message is only printed if the pattern wasn't found. Just like the way you use "if" and "unless" in English. Makeshifts last the longest.
In Section
Meditations
|
|