Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: sumof - attempting to sum a column from each file

by choroba (Abbot)
on Sep 14, 2012 at 15:52 UTC ( #993746=note: print w/ replies, xml ) Need Help??


in reply to sumof - attempting to sum a column from each file

You are resetting and redeclaring $sumof inside the loop. Therefore, it cannot hold the sum value when you print it.
You can use strict and warnings to make Perl guard these (and many more) errors.

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: sumof - attempting to sum a column from each file
Re^2: sumof - attempting to sum a column from each file
by ricky5ive (Initiate) on Sep 14, 2012 at 23:19 UTC
    I think I'm going to rewrite my script from scratch to get a better hang of the suggestions and see the whole picture as I write it. I appreciate all your input, as this has greatly helped me.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993746]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (11)
As of 2014-09-17 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (74 votes), past polls