|
|
| "be consistent" | |
| PerlMonks |
Re: Logical/defined or as lvalueby LanX (Saint) |
| on Sep 03, 2024 at 19:57 UTC ( [id://11161549]=note: print w/replies, xml ) | Need Help?? |
|
I wasted too much time on this ;) Anyway, my best suggestion, please don't use this deref-ref syntax for the sake of readability Try something like the following ors or defs and you are free to chain even more than two operators and assign too.
This could also be included in a module like List::Util (if really missing, compare any and all )¹ Regarding documentation: the perlop Doc for // also covers || and &&. They talk at length about returning the scalar value of the first operand because of the Boolean test, this might be related. FWIW, I was also experimenting with
But this doesn't work because I can't specify that the prototype & code-block is an lvalue too. ( Probably a posteriori???) Finally I discovered what looks like a bug at least in 5.36 inside the debugger. feature 'signatures' seems to be enabled by default when testing sub declarations inside a prompt of perl -de0
Cheers Rolf
¹) I'm having a deja-vu right now, did we discuss this before?
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||