Modules let you package reusable code into files that you can use elsewhere. They typically return a true value at the end.
Save this as MyMath.pm:
In your script:
@EXPORT_OK array controls what your module exports. Always 1; at the end or Perl will puke.