http://www.perlmonks.org?node_id=970464


in reply to PERL modules named differently than the package won't export

The problem is that if you use a different name in the use statement than what you have named the package, Perl will try to call the import method on the wrong package.  In your case, it tries to call Utils1->import, and, as there is no such package/method, nothing is being called and consequently nothing imported.

So don't do this.  Or if you really want to, make the appropriate import call yourself. I.e. instead of use Utils1, write:

BEGIN { require Utils1; Utils->import; }

Replies are listed 'Best First'.
Re^2: PERL modules named differently than the package won't export
by kovacsbv (Novice) on May 15, 2012 at 16:44 UTC

    Thanks, Eliya.

    That solved the problem. Now I can modify the .pm and use it in a more risk-tolerant .pl and when we're all comfortable that it won't blow up, we can start moving it into other .pl files that are risk-averse.