Guay Jean-SÃbastien wrote: > I am sorry David, it just seems like I am having trouble communicating > clearly. We are apparently in a disagreement, but your points are not at > all what I wanted to explain... I'll try again.
i totally understand what you are saying and like i said before, your point is well taken but you failed to explain the reasons behind it and you use a couple of examples that have syntax error which doesn't serve that well. > >> unfortunately, other than coding style, the following is >> EXACTLY the same: >> >> [panda]# perl -e 'open(A,"F") || die' >> [panda]# perl -e 'open A,"F" or die' > > True, but these are not. > > [panda]# perl -e 'open(A,"F") || $_ += 2' > [panda]# perl -e 'open A,"F" or $_ += 2' > well, they are not because one has a syntax error which will never "equal" to anything that's legal Perl. > which when deparsed, respectively give: > open(A, 'F') || $_ += 2; > $_ += 2 unless open A, 'F'; > > One gives a syntax error ( Can't modify logical or (||) in addition (+) at > -e line 1, near "2;" ) right. so please let's not use it as an example because it simply wont' run. > > Of course, in all these cases, using parentheses to fix precedence is an > alternative. But using or also makes the code read more like English, > which (in my humble opinion) makes it easier to understand, and > self-documenting. But that's very subjective... > right. you should state that OP's version is correct as well and that you want OP to change it because you feel your version is better for personal perference and because of possible precedence problem with '||' in other cases. >> you also failed to tell the OP >> that they are the same and now the OP will never use '||' >> again and he will >> go around and spread that word that 'open(...) || die' is >> wrong which is not! > > I don't remember ever saying it's wrong, or to never use '||'. Everything > I said was personal preference, but I still think it's a good practice. If > what I said was interpreted otherwise, I am sorry. Natural language is so > ambiguous! :-) > right. i could have interpreted it the other way as well. :-) > I hope I made my points clear. I am sorry if my first posts mislead > anyone, or if the explanations left to be desired. I hope this message > sets all of that straight. it does. even if it doesn't and OP end up using 'open H,"F" or die' it's no big deal. all i don't want OP (or other beginners) to think is that 'open(H,"F") || die' is not correct. david -- s$s*$+/<tgmecJ"ntgR"tgjvqpC"vuwL$;$;=qq$ \x24\x5f\x3d\x72\x65\x76\x65\x72\x73\x65 \x24\x5f\x3b\x73\x2f\x2e\x2f\x63\x68\x72 \x28\x6f\x72\x64\x28\x24\x26\x29\x2d\x32 \x29\x2f\x67\x65\x3b\x70\x72\x69\x6e\x74 \x22\x24\x5f\x5c\x6e\x22\x3b\x3b$;eval$; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>