in reply to using libaries

perlmod Your .pm file must end with a true value. Make the last line 1;

update: While you're editing arithmetic.pm, take another look at sub gcd() {. With the () you are prototyping gcd as having no parameters. Remove the parens.

In your main program, if ($m = 1 ){ would always succeed, because you're assigning 1 to $m. Testing $m for the value 1 requires ==.