in reply to use of print f and sprint f
Have a look at the dokumentation of printf:
perldoc -f sprintf
You need a format string to format your values. You can try something like this:
printf "$l, $j, %.3f, %.3f, %.3f, %.3f\n", $Hx, $Hy, $Hxy, $mutual;
In Section
Seekers of Perl Wisdom