in reply to Re^2: are installed modules relocatable?
in thread are installed modules relocatable?

If you're now asking about WWW::Mechanize specifically, you can easily answer that yourself.
  • Comment on Re^3: are installed modules relocatable?

Replies are listed 'Best First'.
Re^4: are installed modules relocatable?
by aquarium (Curate) on Nov 09, 2010 at 02:40 UTC
    i used mechanize.pm as an example. so if scripts have "use www::mechanize" it would break if you move mechanize.pm into another directory not named www. the point (if any) i was trying to make is that moving installed modules can break scripts if the module is a sub-module. so you can't just move any/every module without some possible little problems. And if you do move (for example) mechanize.pm into a directory not named www and try to "use mechanize" instead, hopefully it still works and doesn't break ISA?
    the hardest line to type correctly is: stty erase ^H

      If you really, really want to do this (and I'm not saying that this is a good idea), read about how use and require work. Then it's easy to either manually replicate what they do, with appropriate changes, or to do further reading about @INC and to unshift your own handler onto it.

      i used mechanize.pm as an example

      Then you're seeking a generic answer and I had already given that.

      it would break if you move mechanize.pm into another directory not named www

      Correct, you are not free to change the directory structure, just to copy or move it. (At least, not without making additional changes.) Your library directory is .../lib/, not .../lib/WWW/.

      And if you do move (for example) mechanize.pm into a directory not named www and try to "use mechanize" instead, hopefully it still works and doesn't break ISA?

      In general, this won't work because the module's import won't get found. Again, you are not free to change the directory structure, just move it.