Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Testing of exception during import

by kcott (Archbishop)
on Jul 02, 2022 at 04:44 UTC ( #11145235=note: print w/replies, xml ) Need Help??

in reply to Testing of exception during import

G'day Dirk80,

You may already be aware of this, but in case not, I thought I'd point out that your import routine will not be called if your module is loaded like this:

use My::Test ();

See the use function, in particular:

"... there is a distinction between omitting LIST (import called with no arguments) and an explicit empty LIST () (import not called)."

It's possible that you have an "XY Problem" here. If you provided some information about the specific problem you're trying to solve, we may be able to offer other (better) solutions.

— Ken

Replies are listed 'Best First'.
Re^2: Testing of exception during import
by Dirk80 (Pilgrim) on Jul 05, 2022 at 08:59 UTC

    Thank you all for your answers. The problem was that simple. I fully understood your answers and everything works fine. I'm really glad about this great community and that you help me even if I have sometimes beginner questions.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11145235]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2022-08-17 21:57 GMT
Find Nodes?
    Voting Booth?

    No recent polls found