"Test.pl" #use lib "./Nzd/"; ->not sure if this should be here #push @INC, "./Nzd/"; ->not sure if this should be here use strict; use warnings; use Nzd::NZD; #Nzd is a directory containing NZD.pm my ($x,$y)= (8,36); my $t=NZD($x,$y); my $c=$x/$t; my $g=$y/$t; print "\nc= $c, g= $g"; ------------------------------------ "NZD.pm" package Nzd::NZD; use strict; sub NZD { my ($x, $b) = @_; if ($x > $b){ ($x,$b) = ($b,$x); } while ($x) { ($x, $b) = ($b % $x, $x); } return $b; } 1;