Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by choroba (Canon)
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
Replies are listed 'Best First'.
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 imbibing at the Monastery: (12)
As of 2015-07-30 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls