Here's what happens when you use() your mymodule.pm the first time. The file mymodule.pm is located and compiled. You didn't declare a new package so everything is loaded into your current package. Then mymodule->import() is attempted. That doesn't exist so nothing happens. Your next module use()'s mymodule. Now only mymodule->import() is called. This is how you tell perl that this file has things to export. When you don't use packages and Exporter then perl will assume it's already compiled the thing and not bother trying again.
Here are some workarounds:
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
In reply to Re^3: Loading a module into many packages
by diotalevi
in thread Loading a module into many packages
by arkturuz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |