Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Specific hash to array conversion query

by davidrw (Prior)
on Jul 12, 2005 at 13:02 UTC ( [id://474264]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Specific hash to array conversion query
in thread Specific hash to array conversion query

thanks! For other keys, you can nest a map in there .. trick is to use a temp variable for the outer $_. Remember that you can put any code inside the map--it's only the value of the last statement that matters/is returend. I also tossed a sort of the file results in there so that it's exactly what you put in your OP:
my @values = sort { $b->[0] cmp $a->[0] || $a->[1] <=> $b->[1] } map { my $k = $_; map { [ $k, $_, $properties{$k}->{$_}->{value} ] } keys %{$propert +ies{$k}}; } keys %properties;
Update: Now that i read the rest of the thread and see that Zaxo and Transient provided the exact same nested map.. I like the post-sort on mine though :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-24 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found