Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: ~~ and list literal

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

in reply to Re: ~~ and list literal
in thread ~~ and list literal

TIL that parentheses don't imply a list context. Also these don't:

"x" ~~ qw(x y z) "x" ~~ sort(x y z)

I find that only this do: "x" ~~ @{["x", "y", "z"]}

Any other which I missed?

Replies are listed 'Best First'.
Re^3: ~~ and list literal
by 2teez (Vicar) on Oct 26, 2012 at 00:03 UTC

    TIL that parentheses don't imply a list context

    Ofcourse, I never said parentheses imply a list context, it's the comma operator that does.
    But, what I did say/wrote is that the smartmatch ..infers contexts from the actual types of its operands and uses that type information to select a suitable comparison mechanism...

    Any other which I missed?
    Please, check perlop for detailed information

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000966]
and the sunlight beams...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2018-03-17 06:58 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (223 votes). Check out past polls.