in reply to Re: if multiple conditions & Warinings....
in thread if multiple conditions & Warinings....

For you problem  ne compares two strings, which  /^[+-]\d+$/ is not.

Actually, the problem with the  $VAR1 ne /^[+-]?\d+$/ expression in the OPed code is much more pernicious. In the absence of a  =~ binding operator,  // matches against the  $_ default scalar. If this scalar has a defined value, there will be no warning even if warnings are enabled. The  // match occurs in scalar context imposed by the  ne comparison operator. In scalar context,  // returns 1 (true) if there is a match and '' (empty string: false) if not. The  ne operator will stringize a 1 returned from a successful match. The  ne operator will stringize  $VAR1 and compare that against whatever resulted from the  // match. If  $VAR1 is defined, there will be no warning if warnings are enabled. Most of the values one can imagine  $VAR1 to contain will not (stringwise) equal either '1' or the empty string, thus setting the stage for very puzzling behavior.

So even with strictures and warnings enabled, you might have been left with a devilish bug. Well, Perl is neither magical nor telepathic. There has to be some reason for the existence of the programmer, and that's why we earn the Big Buck$.