🐪 Perl Modules

Modules let you package reusable code into files that you can use elsewhere. They typically return a true value at the end.

🖥️ Example 1: Creating a Module

Save this as MyMath.pm:

🖥️ Example 2: Using the Module

In your script:

Output will appear here...
💡 Tip: The @EXPORT_OK array controls what your module exports. Always 1; at the end or Perl will puke.