in reply to Re: Re: Re: My coding guidelines
in thread My coding guidelines
If not, why not? What do you use instead? I find not is usually the cleanest and most readable operator for all sorts of tests.
It's just a matter of taste. I'm not against using not, I just don't happen to prefer it.
You give the following example:
print "$pattern not found in $file\n" if not $found;
In this case I would use unless:
print "$pattern not found in $file\n" unless $found;
As for if (not -r $file) {...}, I typically use the bang operator (!) rather than not -- just a matter of preference, probably due to my C influences.
Matt
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: My coding guidelines
by Aristotle (Chancellor) on Nov 30, 2002 at 18:18 UTC | |
Re: Re(4): My coding guidelines
by helgi (Hermit) on Dec 02, 2002 at 16:27 UTC |
In Section
Meditations