in reply to Re^4: combining two csv files by using math operations
in thread combining two csv files by using math operations
And instead you got ... ?
Still seems to work as expected with a one-line SSCCE.
Try taking the file ops out of the equation, and add some debugging during the flow to see that your variables contain what you think they do.$ perl -Mstrict -wE 'my $avg = (1.0 + 3.0) / 2.; say sprintf("%E", $av +g)' 2.000000E+00
Hope this helps!
The way forward always starts with a minimal test.
In Section
Seekers of Perl Wisdom