Re: REGEXP removing - il- - -b-f and - il- - - - f



Jay Savage wrote:

4> open (V4, "samcmd v4 2>\&1 |" ) || die "unable to open pipe... Broken?$!";

Don't do this.  the precedence of || is too high.  your code attempts
to open a pipe, and if it can't, then it attempts to open "die..." and
starts throwing exceptions.

No, that is NOT what happens, it will NEVER attempt to open "die..." with or without the parentheses. The ONLY time it will attempt to open "die..." is if there are no parentheses and the expression on the left hand side of the || operator evaluates to false.

open V4, '0' || die $!;

But even then it will NOT attempt to open "die..." because die() exits the
program!



John
--
use Perl;
program
fulfillment
.



Relevant Pages

  • Re: operator precedence in Fortran 2008 draft
    ... to take operands of type BITS. ... to overload the relational operators as well, ... the operator precedence chosen by standard ... forces the use of parentheses in the common cases. ...
    (comp.lang.fortran)
  • Re: question about pointer
    ... parentheses will somehow force complete evaluation of the increment ... Overriding precedence can sometimes have the effect of ... same - the parens are redundant. ...
    (comp.lang.c)
  • Re: Which has higher precedence & or ==
    ... Unfortunately I do have to worry about it. ... George Hester ... >> But I don't know what the precedence was expected here to put the ... > Add parentheses to make it mean what you wanted it to mean - don't worry too ...
    (microsoft.public.vc.language)
  • Re: VHDL Operator associativity (Quartus II parser bug?)
    ... states that or and and have the same precedence. ... Yes, but LRM 7.1 gives the BNF for expressions, ... in an expression without parentheses, ... DOULOS - Developing Design Know-how ...
    (comp.lang.vhdl)
  • Re: Reason for operator precedence
    ... Having multiple levels of precedence obviously adds complexity, ... I meant to make it work without needing parentheses, ... convention of your choice. ... Polish or Reverse Polish notation. ...
    (sci.math)