Some pointers.
Always put use strict; and use warnings at the top of your scripts and declare your variables with my as this will save you time tracking down errors.
Always indent your code to make it easier to follow the logical flow and be consistent.
It is probably better not to have a scalar and an array both called value as this can lead to confusion. Make the array @values as it better describes its purpose.
Why are you incrementing the $count by one every time through the loop rather than adding the value as entered and held in $line to it?
Why are you spliting the each value into individual characters then setting $count to the number of characters (array in scalar context returns number of elements), thus undoing any previous work of accumulating a total?
Your problem lies with those last two points. Have a think about the logic required to accumulate a series of values.
Cheers,
JohnGG
In reply to Re: having trouble with count
by johngg
in thread having trouble with count
by bjohn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |