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
In reply to Re: A Beginner Needs Homework help
by InfiniteSilence
in thread A Beginner Needs Homework help
by Swizzlestix617
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |