sami.strat has asked for the wisdom of the Perl Monks concerning the following question:
If I turn on warnings, diagnostics, and strict I get the following errors:if ($VAR1 != 2 || $VAR1 ne /^[+-]?\d+$/ ) { do something; }
If I remove warning, strict, and diagnostics, the script works fine. Is there anything I can do to clean this script up such that I can leave strict, warning, and diagnotics in, without getting the error? Thanks in advance.[root@monitor app]# ./checker 10.175.193.55 Argument "External command error: Error in packet\nReason: (noSuch..." + isn't numeric in numeric ne (!=) at ./checker line 106 (#1) (W numeric) The indicated string was fed as an argument to an oper +ator that expected a numeric value instead. If you're fortunate the me +ssage will identify which operator was so unfortunate. Argument "External command error: Error in packet\nReason: (noSuch..." + isn't numeric in numeric ne (!=) at ./checker line 147 (#1) Controller Status Change Array Accelerator Battery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: if multiple conditions & Warinings....
by davido (Cardinal) on Aug 21, 2013 at 19:59 UTC | |
|
Re: if multiple conditions & Warinings....
by Eily (Monsignor) on Aug 21, 2013 at 18:49 UTC | |
by AnomalousMonk (Archbishop) on Aug 22, 2013 at 01:50 UTC | |
|
Re: if multiple conditions & Warinings....
by Laurent_R (Canon) on Aug 21, 2013 at 18:53 UTC |