Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: are installed modules relocatable?

by aquarium (Curate)
on Nov 08, 2010 at 23:52 UTC ( [id://870216]=note: print w/replies, xml ) Need Help??


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

would it still work if you moved say Mechanize.pm to another directory and then tried to use www::mechanize?
the hardest line to type correctly is: stty erase ^H

Replies are listed 'Best First'.
Re^3: are installed modules relocatable?
by ikegami (Patriarch) on Nov 09, 2010 at 00:22 UTC
    If you're now asking about WWW::Mechanize specifically, you can easily answer that yourself.
      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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-03-19 05:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found