http://www.perlmonks.org?node_id=1000813


in reply to ~~ and list literal

What are you trying/hoping to do?

$ perl -MO=Deparse,-p - print( "x" ~~ ("x", "y", "z") ); ^Z print(('x' ~~ ('???', '???', 'z'))); - syntax OK
??? means value is discarded, meaning it is same as 'x' ~~ 'z'

Aside from changing the code to  "x" ~~ ["x", "y", "z"], is there another way?

Yeah, without ~~

Replies are listed 'Best First'.
Re^2: ~~ and list literal
by Anonymous Monk on Oct 25, 2012 at 11:38 UTC
    I was trying to find an element in a list, like in an array with "x" ~~ @ary (which works).