in reply to Re^3: How to return a two dimensional array from a function in Perl?
in thread How to return a two dimensional array from a function in Perl?

my style decisions

That sounds a lot like "personal preference".

And if "the precedence difference." is your justifiction of entreating other to [only] "Use && and || inside of expressions.", and you "can't remember any examples" of how not following that entreaty will cause any problems, (beyond perhaps offending your sensibilities), then it also sounds pretty groundless.

As someone once said: In the absence of evidence, opinion is indistinguishable from prejudice.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re^4: How to return a two dimensional array from a function in Perl?

Replies are listed 'Best First'.
Re^5: How to return a two dimensional array from a function in Perl?
by ikegami (Patriarch) on Nov 03, 2008 at 21:31 UTC

    That sounds a lot like "personal preference".

    Of course. Why would I be advocating a position other than my own.

    And if "the precedence difference." is your justifiction of entreating other to

    No, it's traps resulting from that precedence difference.

    As someone once said: In the absence of evidence, opinion is indistinguishable from prejudice.

    Did you read the parent post at all? I have seen evidence of it causing problems.

      Did you read the parent post at all?

      Yes.

      I have seen evidence of it causing problems.

      Show us (me) the code. One example of where using and or or instead of && or ||, inside an if statement condition (per the OP) "causes problems"?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
Re^5: How to return a two dimensional array from a function in Perl?
by SuicideJunkie (Vicar) on Nov 03, 2008 at 14:34 UTC
    There have been a few such examples that have been brought up by SoPW. I don't recall the details of any of them either, but it is pretty straightforward to build an example.

    If you use the wrong operator (&& vs and) then a number of low precedence operators will not behave as you expect:
    use strict; use warnings; print "&&: "; print 1 && 1 ? 0 : 1; print "\nand: "; print 1 and 1 ? 0 : 1;
    This prints:
    &&: 0 and: 1
    So, if you don't mind your code doing completely unexpected things, then you don't need to distinguish between "&&" and "and".
      a number of low precedence operators will not behave as you expect

      Um. No. They behave exactly as I expect in both cases. Which immediately puts paid to this strawman: So, if you don't mind your code doing completely unexpected things,.

      then you don't need to distinguish between "&&" and "and".

      S'funny. I don't recall anyone, neither I nor ikegami, suggesting that.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        They behave exactly as I expect in both cases.

        Your emphasis is most appropriate. Not everyone trips over the same traps. If you're immune to it, great!