How do you use exporting symbols (Exporter) with a short example?

In Perl, the `Exporter` module is a practical way to make your module's functions and variables available to the users without requiring them to prefix them with the package name. By using `Exporter`, you can control which symbols are exported and which are not, making your API cleaner and easier to use.

Here's a short example demonstrating the use of `Exporter`.

package MyModule; use Exporter 'import'; # Functions to export our @EXPORT = qw(hello world); sub hello { return "Hello from MyModule!"; } sub world { return "World!"; } 1; # Return true to indicate the module loaded successfully

Perl Exporter symbols modules programming code example