in reply to Re^2: using perl installed in another computer
in thread using perl installed in another computer

The reason for all the machines to see perl as installed in the same location is so that you can update Config.pm. (I realise that case is unimportant on Windows, but I like to use the Unix case since it works everywhere.)

If the values in Config.pm are incorrect, then diagnostics won't work, and I'd imagine there may be other modules that may not work, although I haven't yet hit upon them (because I use diagnostics, I already have Config.pm fixed everywhere, so I wouldn't see further problems).

Just scan through your Config.pm (the one in your lib directory) for where you have perl already installed, and change those instances of the directory to the new directory, and you're all set.

  • Comment on Re^3: using perl installed in another computer

Replies are listed 'Best First'.
Re^4: using perl installed in another computer
by Anonymous Monk on Mar 31, 2005 at 04:59 UTC
    Hello,

    Thanks for the reply. So, each remote computer would need a perl installed? Since the config.pm file exists in C:\Perl\lib directory as you had mentioned.

    Also, the following variables seem to need changing to the drive the main computer is mapped to. Please let me know if I am missing anything:

    archlibexp='C:\Perl\lib' installarchlib='C:\Perl\lib' installprivlib='C:\Perl\lib' libpth='"C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\L +ib\" "C:\Perl\lib\CORE"' prefix='C:\Perl' privlibexp='C:\Perl\lib' archlib='C:\Perl\lib' bin='C:\Perl\bin' binexp='C:\Perl\bin' sitearch='C:\Perl\site\lib' sitearchexp='C:\Perl\site\lib' sitebin='C:\Perl\site\bin' sitebinexp='C:\Perl\site\bin' sitelib='C:\Perl\site\lib' sitelib_stem='' sitelibexp='C:\Perl\site\lib' siteprefix='C:\Perl\site' siteprefixexp='C:\Perl\site' perlpath='C:\Perl\bin\perl.exe'

    Thanks.

      So, each remote computer would need a perl installed? Since the config.pm file exists in C:\Perl\lib directory as you had mentioned.
      No, on Win32, the location C:\perl\lib is not harwired into perl.exe. Instead perl.exe infers the default @INC (Perl module search path) at runtime from the location of perl.exe.

      Actually even if the location were hardwired it would be patched at install time so it would still be sufficient to simply install the .MSI into the shared drive using the mapped drive letter.

        Thank you for the reply

        Could you repeat that in english? :)

        So, I don't need perl installed in the remote computers? I understood that in the remote computers, I would need to map drive U: (for example) to the main computer.

        Then, I will need to install .MSI file on the main computer? Where can I get a .MSI?

        Thanks

      As nobull points out, you can simply install to the shared drive directly, and then everything would be updated automatically.

      Let's say you decided that everyone would mount all shared utilities on drive "U" (for utility). You could just change all "C:\Perl"s to "U:\Perl" and everything should work fine after that. (As nobull also kind of pointed out, most things would work fine without this change, but debugging why your script doesn't work with use diagnostics on a remote machine is painful - trust me. So I'm trying to ensure you don't have that problem. Other problems, perhaps, but not the same ones I've had ;->). Something like this should work, given that you started with perl on drive C, and follow the above example:

      perl -pi.bak -e 's/C:\\Perl/U:\\Perl/g' Config.pm
      Your favourite editor probably has a search&replace function, too. But when you have perl already, why not take advantage of it ;-)

        Hello there!

        I am implementing your suggestion and noticed that there were a couple of config.pm's in the perl directory.

        Eg: C:\Perl\Lib C:\Perl\Lib\CPAN C:\Perl\lib\Encode C:\Perl\lib\Net C:\Perl\site\lib etc...

        Which config.pm file would need to be updated? all?

        Thanks in advance.

Re^4: using perl installed in another computer
by bmann (Priest) on Mar 31, 2005 at 22:04 UTC
    Actually, case is extremely important on Windows. While the file system is case-insensitive, perl is not. This can cause strange errors that can be hard to diagnose.

    If you have a windows box handy, try the following:

    use Strict; # use strict; my $val = 5000; $va1++; # no "Global symbol..." error here print $va1;
    or On a unix system, perl would complain loudly that it "can't find Strict.pm in @INC". Windows will quietly load strict.pm instead of Strict.pm, and then mysteriously fail to catch a minor typo.

    Another variation:

    use lwp::simple; # not LWP::Simple getprint 'http://yahoo.com'; # (Do you need to predeclare getprint?)
    Of course, you probably already know this, but I hope this keeps someone else from being tripped up by it.

      I was only referring to the filename, not the contents ;-) e.g., if you bring up config.pm or Config.pm in your favourite editor, it wouldn't matter.

      But, on that topic, if you were to do something that didn't require importing, it'd work just fine...

      use lwp::simple; LWP::Simple::getprint('http://yahoo.com');
      Of course, the actual use must be perfectly accurate with regards to case.

      But now we're getting extremely pedantic :-)