[Chicago-talk] Combine like hash elements

richard at rushlogistics.com richard at rushlogistics.com
Mon Nov 23 08:36:18 PST 2015


Did not include it because it did not come close but if you must see it 
here it is:
 
 %$w_ref = sort { %$w_ref{$a}  %$w_ref{$b} } keys %$w_ref;

On Mon, 23 Nov 2015 10:17:39 -0600, Shawn Carroll  wrote:

       At the risk of sounding like StackOverflow, what have you tried?

shawn.c.carroll at gmail.com
Software Engineer
Soccer Referee

On Mon, Nov 23, 2015 at 10:10 AM,  wrote:

       I have a hash reference with the following structure:

{
'11' => {'AMOUNT' => '20.00','ID' => '11','NAME' => 'Lincoln Park'},
'12' => {'AMOUNT' => '38.00','ID' => '12','NAME' => 'Bucktown'},
'13' => {'AMOUNT' => '41.00','ID' => '12','NAME' => 'Lincoln Park'}
}

Can anyone tell me how I can combine them by 'NAME' so that I would have:

{
'11' => {'AMOUNT' => '61.00','ID' => '11','NAME' => 'Lincoln Park'},
'12' => {'AMOUNT' => '38.00','ID' => '12','NAME' => 'Bucktown'},
}

Thanks
_______________________________________________
Chicago-talk mailing list
Chicago-talk at pm.org
http://mail.pm.org/mailman/listinfo/chicago-talk

-------------------------

_______________________________________________
Chicago-talk mailing list
Chicago-talk at pm.org
http://mail.pm.org/mailman/listinfo/chicago-talk


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20151123/4efee978/attachment.html>


More information about the Chicago-talk mailing list