in reply to How do I get the root mean square of a list?

Been a while since I worked with RMS values, but from what I remember your code looks a little overcomplex. What's wrong with this:

sub rms { my $sq; $sq += $_ * $_ foreach @_; sqrt($sq/@_); }