We don't bite newbies here... much | |
PerlMonks |
Ambiguous '~~' in 'print scalar ~~list'by rsFalse (Chaplain) |
on Mar 12, 2019 at 13:10 UTC ( [id://1231158]=perlquestion: print w/replies, xml ) | Need Help?? |
rsFalse has asked for the wisdom of the Perl Monks concerning the following question:
Hello. I was playing with '~~' "operator" (perlsecret#Inchworm), which is equivalent to 'scalar()' if parsed as two consecutive unary bit-inverting operators, not as experimental smartmatch op. And there is a case where parser can't understand what do I mean (unary forcing scalar or binary smartmatch): STDOUT: empty STDERR: Smartmatch is experimental at smartmatch_or_scalar.pl line 9. > cat out.txt 3 In my opinion usual operators (bit-inversion) should be in higher precedence of parsing than experimental operators, but in my code '~~' was interpreted as experimental smartmatch.
Back to
Seekers of Perl Wisdom
|
|