in reply to ~~ and list literal
..It is also unique in that all other Perl operators impose a context (usually string or numeric context) on their operands, autoconverting those operands to those imposed contexts. In contrast, smartmatch infers contexts from the actual types of its operands and uses that type information to select a suitable comparison mechanism...
with use warnings in your script turn on, it would shout"Useless use of a constant (x),(y) in void context". Which shows you are inferring a void context using smartmatch like so.print( "x" ~~ ("x", "y", "z") );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ~~ and list literal
by Anonymous Monk on Oct 25, 2012 at 23:43 UTC | |
by 2teez (Vicar) on Oct 26, 2012 at 00:03 UTC |