Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Pkg::END{} executes 2+ times, on how many times use Pkg; or do Pkg.pm;

by Corion (Patriarch)
on Jan 22, 2010 at 16:41 UTC ( [id://818995]=note: print w/replies, xml ) Need Help??


in reply to Pkg::END{} executes 2+ times, on how many times use Pkg; or do Pkg.pm;

If you don't want to load code twice, use use or require. Using do is a bad idea as you found, as it will re-execute the code every time, and add the END{} blocks every time as well.

  • Comment on Re: Pkg::END{} executes 2+ times, on how many times use Pkg; or do Pkg.pm;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-07-20 21:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.