Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: One-liner to join keys on a two-dimensionnal hash ?

by ikegami (Patriarch)
on Dec 29, 2021 at 15:07 UTC ( [id://11140009]=note: print w/replies, xml ) Need Help??


in reply to Re^2: One-liner to join keys on a two-dimensionnal hash ?
in thread One-liner to join keys on a two-dimensionnal hash ?

That the point of map. It takes a list of inputs, and produces a different list from those inputs. It does so by applying the transformation function (the block or expression) to each input, and collecting the outputs of that function.

Examples:

my @uc = ( uc("abc"), uc("def") ); | v my @uc = map { uc($_) } "abc", "def";
my %h = ( "abc" => 1, "def" => 1 ); | v my %h = map { $_ => 1 } "abc", "def";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-25 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found