In the data you provided there is no duplicate keys, so no adding will happen. The key is the concatenation of $subc and $state and this combination creates unique keys for your data.
See below where I integrated you MAP and REDUCE into on loop.

use strict; use warnings; my %worth; while ( <DATA> ) { chomp; my( $txnid, $date, $custid, $amount, $productc, $subc, $city, +$state, $mode ) = split /,/; $worth{"$subc.$state"} += $amount; # REDUCE } while( my ( $key, $value) = each %worth ) { print "key: $key, value: $value\n"; } __DATA__ 00000000,06-26-2011,4007024,040.33,Exercise & Fitness,Cardio Machine A +ccessories,Clarksville,Tennessee,credit 00000001,05-26-2011,4006742,198.44,Exercise & Fitness,Weightlifting Gl +oves,Long Beach,California,credit 00000002,06-01-2011,4009775,005.58,Exercise & Fitness,Weightlifting Ma +chine Accessories,Anaheim,California,credit 00000003,06-05-2011,4002199,198.19,Gymnastics,Gymnastics Rings,Milwauk +ee,Wisconsin,credit 00000004,12-17-2011,4002613,098.81,Team Sports,Field Hockey,Nashville + ,Tennessee,credit 00000005,02-14-2011,4007591,193.63,Outdoor Recreation,Camping & Backpa +cking & Hiking,Chicago,Illinois,credit 00000006,10-28-2011,4002190,027.89,Puzzles,Jigsaw Puzzles,Charleston,S +outh Carolina,credit 00000007,07-14-2011,4002964,096.01,Outdoor Play Equipment,Sandboxes,Co +lumbus,Ohio,credit 00000008,01-17-2011,4007361,010.44,Winter Sports,Snowmobiling,Des Moin +es,Iowa,credit

In reply to Re^3: Create a Hash Dynamically and add the values of same key by hdb
in thread Create a Hash Dynamically and add the values of same key by rahulruns

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.