in reply to The Swiss Army Chainsaw... Watch out for your legs there, buddy!
This is why we yell, scream, and wave our arms about strict and warnings. With warnings, we get:
$ perl -wle 'my $param = "foo"; if ($param != null) {}' Unquoted string "null" may clash with future reserved word at -e line +1. Argument "null" isn't numeric in numeric ne (!=) at -e line 1. Argument "foo" isn't numeric in numeric ne (!=) at -e line 1.
And with strict we get:
$ perl -Mstrict -wle 'my $param = "foo"; if ($param != null) {}' Bareword "null" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors.
So, tell your coworkers to use strict and warnings unless they know what they're doing. Which, unfortunately, the code you've shown kind of leads me to believe they don't (at least when it comes to Perl).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: The Swiss Army Chainsaw... Watch out for your legs there, buddy!
by nimdokk (Vicar) on Jul 25, 2006 at 17:43 UTC |