Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Re: Was my module used or required?

by Jenda (Abbot)
on Dec 06, 2002 at 11:29 UTC ( [id://218037]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Was my module used or required?
in thread Was my module used or required?

If you know about BEGIN{} blocks you should also know that there is not two separate compile and runtime phases. These two are interleaved. Even if neither you nor the module authors use any BEGIN blocks!

I'm afraid you'll have to rethink this. Consider this:

#!/usr/bin/perl BEGIN { push @INC, '/some/directory'; require Your::Module; } ...

This way your module is being included as soon as at all possible, yet it's require()d, not use()d.

If you tell us what and why do you want to do differently we can come up with something. Just now my only idea is to set a variable when the script "starts". $My::Module::Runtime=1 is probably the best you can get.

Jenda

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-20 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found