Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Re: Re: A Guide to Installing Modules

by Fastolfe (Vicar)
on Dec 29, 2001 at 09:44 UTC ( #135074=note: print w/replies, xml ) Need Help??

in reply to Re: Re: A Guide to Installing Modules
in thread A Guide to Installing Modules

Why would you need to?

I don't believe there are any mechanisms available to completely uninstall a module (assuming it wasn't installed with a package management system like RPM). If you just want to make a module unavailable to scripts, just find and delete the file.

  • Comment on Re: Re: Re: A Guide to Installing Modules

Replies are listed 'Best First'.
Re: Re: Re: Re: A Guide to Installing Modules
by mirod (Canon) on Dec 29, 2001 at 18:53 UTC

    I found at least one good reason to do this: if the code you are writing tests whether a module is available (through an eval { require Module;} and defaults to a less-than-optimal-but-acceptable behaviour if the eval returns an error. Then you need to test both cases, with and without the module. A workaround is to wrap the eval in a test controlled by an environment variable, so when testing you can pretend that the module was not here. This is not perfect (the module could be imported by an other part of yur code or by an other module) but it is usually the easiest way to "desinstall" a module.

      In this situation I would simply modify my code to allow me to test both situations by only requiring the module if a certain flag was set (or unset). Then I could just flip the value of the flag whenever I wanted to test the other bit of code. Certainly easier than uninstalling/reinstalling modules.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://135074]
[Discipulus]: shmem the first time I was in germany I was so smart to learn by heart the address of the hostel: Einbahnstraße..
[Discipulus]: james28909 you are welcome
james28909 doesnt drink much alcohol
james28909 does enjoy blazing up though
james28909 also walks around hunting for his cell phone while using its flashlight function

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2018-05-20 16:19 GMT
Find Nodes?
    Voting Booth?