note
1nickt
<P>
And instead you got ... ?
</P>
<P>
Still seems to work as expected with a one-line [SSCCE].
<c>
$ perl -Mstrict -wE 'my $avg = (1.0 + 3.0) / 2.; say sprintf("%E", $avg)'
2.000000E+00
</c>
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.
</P><P>Hope this helps!</P><BR>
<div class="pmsig"><div class="pmsig-1130276">
<i>The way forward always starts with a minimal test.</i>
</div></div>
11132653
11132659