in reply to Difference between executing and "using" a .pm file
So to make your use case consistent with a modulino approach, rename your .pm to .pl; keep the caller based context dispatching and you can call your .pl script a modulino.
But this is sort of going backwards. Like I said above, if you have a .pm file already; just use it in a .pl. The whole point of a modulino really is ephermal; sure they can be long lived, but it's most useful when refactoring legacy code bases into a modular/library centric approach.
Another characteristic of your .pm not being a fully encapsulated module (and maybe inappropriately serving as a modulino) is if you have any commandline argument processing anywhere in it - be it ad hoc, Getopts or what have you. This sort of @ARGV munging typically belongs exclusively inside of a .pl (including one that is a modulino).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Difference between executing and "using" a .pm file
by pryrt (Abbot) on Mar 30, 2021 at 20:27 UTC | |
by LanX (Saint) on Mar 31, 2021 at 01:13 UTC | |
by perlfan (Parson) on Mar 30, 2021 at 23:36 UTC | |
|
Re^2: Difference between executing and "using" a .pm file
by Marshall (Canon) on Mar 30, 2021 at 20:35 UTC | |
by perlfan (Parson) on Mar 30, 2021 at 23:39 UTC | |
by Marshall (Canon) on Mar 31, 2021 at 00:34 UTC |