in reply to Re^2: Loading a module into many packages
in thread Loading a module into many packages
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:
⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Loading a module into many packages
by arkturuz (Curate) on Oct 27, 2006 at 14:56 UTC |