will_ has asked for the wisdom of the Perl Monks concerning the following question:
The following code gets a warning: Possible precedence issue with control flow operator
Is this better? If not, what's the best way to write it?
But I've always used or for control flow like "die" or "return", and || for logical expressions where the result doesn't affect which path the program takes (in that line).return something() or croak "something didn't work";
Is this better? If not, what's the best way to write it?
return something() || croak "something didn't work";
ɹǝʞɔɐɥ lɹǝd ɹǝɥʇouɐ ʇsnɾ
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Possible precedence issue with control flow operator
by Eily (Monsignor) on Jan 13, 2020 at 11:23 UTC | |
by Fletch (Bishop) on Jan 13, 2020 at 14:37 UTC | |
by ikegami (Patriarch) on Jan 13, 2020 at 18:12 UTC | |
by LanX (Saint) on Jan 13, 2020 at 18:48 UTC | |
Re: Possible precedence issue with control flow operator
by 1nickt (Canon) on Jan 13, 2020 at 11:27 UTC | |
Re: Possible precedence issue with control flow operator
by davido (Cardinal) on Jan 13, 2020 at 18:24 UTC | |
Re: Possible precedence issue with control flow operator
by LanX (Saint) on Jan 13, 2020 at 17:11 UTC |
Back to
Seekers of Perl Wisdom