Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: ~~ and list literal

by Anonymous Monk
on Oct 25, 2012 at 10:39 UTC ( #1000813=note: print w/ replies, xml ) Need Help??

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 ~~

Comment on Re: ~~ and list literal
Select or Download Code
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).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000813]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2014-09-22 19:51 GMT
Find Nodes?
    Voting Booth?

    How do you remember the number of days in each month?

    Results (198 votes), past polls