Your skill will accomplish what the force of many cannot |
|
PerlMonks |
A Beginner Needs Homework helpby Swizzlestix617 (Novice) |
on Apr 10, 2014 at 03:34 UTC ( [id://1081743]=perlquestion: print w/replies, xml ) | Need Help?? |
Swizzlestix617 has asked for the wisdom of the Perl Monks concerning the following question: Hi. My name's Ang and I'm new (to perlmonks and to Perl, first computer programming class) and I need help with a homework assignment. This is my homework assignment: Consider a file consisting of lines that contain a color and an amount separated by colons, like: red:27 yellow:102 green:311 yellow:12 blue:45 Should output (not necessarily in that order):red:27 yellow:114 green:311 blue:45 Your program must take the input file as a parameter. This is the code I've written:
These are the errors I'm getting.. and I don't understand them, how to fix them.. I feel like I'm not that good at this, so if you decide to help me explain it like I'm a kindergardener.. Argument "27 yellow" isn't numeric in addition (+) at ar991homework411 line 21, <FH> line 1. Argument "102 green" isn't numeric in addition (+) at ar991homework411 line 21, <FH> line 1. Argument "311 yellow" isn't numeric in addition (+) at ar991homework411 line 21, <FH> line 1. Argument "12 blue" isn't numeric in addition (+) at ar991homework411 line 21, <FH> line 1. Odd number of elements in hash assignment at ar991homework411 line 25, <FH> line 1. Thanks for any help! Ang
Back to
Seekers of Perl Wisdom
|
|