in reply to (jeffa) Re: Perl and C don't always mix well
in thread Perl and C don't always mix well

Random tip that works well across several languages.

Turn that test around. If you write it:

if (5 == $number) { # ... }
then you are automatically told your mistake when you write
if (5 = $number) { # ... }
by accident. By contrast you are rather less happy if you write in the naive order and wound up with:
if ($number = 5) { # ... }
which winds up being true rather more often than you would like...