in reply to A Beginner Needs Homework help
There's just too much wrong with your code to even begin trying to fix it. The secret to learning how to code is to do two things:
E:>perl -ne "BEGIN{my %stuff = ()}; @items=split q|: |; $stuff{$items[0]} += $items[1]; END{for(keys %stuff){print qq|$_:$s +tuff{$_}\n|}};" fakedata.dat blue:45 red:27 green:311 yellow:114
Celebrate Intellectual Diversity
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A Beginner Needs Homework help
by Swizzlestix617 (Novice) on Apr 10, 2014 at 04:23 UTC | |
by GrandFather (Saint) on Apr 10, 2014 at 04:41 UTC | |
|
Re^2: A Beginner Needs Homework help
by boftx (Deacon) on Apr 11, 2014 at 02:20 UTC |