Script-Sub-Import reviews

RSS | Module Info | Add a review of Script-Sub-Import

Script-Sub-Import (0.0201) *

Never use this module. What a pitiful module!
Have you ever felt like testing subroutines only in a perl script(.pl)?
I can't imagine such a situation, and neither can see the author's motivation.
The module should go to Acme.

Script-Sub-Import (0.0201) **

The way this module is implemented is considered a hack, and this module should not be used in the first place. There are many, far better ways to do the same thing, a) Check caller() in the script so the main routine won't run, b) Convert your script into a module (.pm) file and make the .pl just call methods/functions.

The only real use case I can think of is when you have bunch of legacy scripts that you cannot touch for some reason, but I assume you have to be able to do that anyway if you want to test or import functions from those scripts.