in reply to Code clarification - use of map and $$_

Inherited code... Hmm, I believe I also see a bareword filehandle there in the print line.

print OUT "$g[0]\t@g[1]\t@g[2]\t@g[3]\t", $x / scalar(@{$r{$k};}), "\t$y\n";

*hisses like a vampire who just suddenly had sunlight cast on him and scurries away rapidly*

UPDATE:

With <IN> as well. Bareword vs. Indirect Filehandle

I love it when things get difficult; after all, difficult pays the mortgage. - Dr. Keith Whites
I hate it when things get difficult, so I'll just sell my house and rent cheap instead. - perldigious