Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

(tye)Re: Reloading modules more than once

by tye (Sage)
on Aug 04, 2002 at 17:49 UTC ( #187511=note: print w/replies, xml ) Need Help??


in reply to Reloading modules more than once

See require. For efficiency, it will only load the same file once. You can override this by doing:     delete $INC{"/path/to/somthing.pm"}; before you try to require that file subsequent times.

You'll likely still run into problems because loading the same code twice isn't the same as loading it once. For example, you'll likely get warnings for each subroutine because they are getting redefined.

There are several techiniques you can try to use to "clear" the package before you reload so that reloaded module is more likely to act like it has never been loaded before. However, none of them work perfectly. For example, I haven't found a good way to reload the module such that other modules that had previously had routines exported to them would see the new routines instead of the old ones.

For example, there is Apache::Reload. See also Reloading Modules.

        - tye (but my friends call me "Tye")

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2023-09-21 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?