Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: keys with an expression

by lune (Pilgrim)
on Nov 20, 2013 at 15:04 UTC ( [id://1063540]=note: print w/replies, xml ) Need Help??


in reply to keys with an expression

I don't know if that worked before, but I do find the error message okay, as
(map { $_ => 1 } @array)
returns a list, not an array, which "keys" would also accept as a valid argument.

You get the same error if you try:

my @unique = keys (1,1,2,3,2,2);

but not with:
my @unique = keys @array;
which returns the indices of the array.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-23 22:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found