sub multigcf { my $x = shift; $x = gcd($x, shift) while @_; #should be gcf! return $x; }