One of the things I do is maintain the execution version of PERL in a root
directory starting with
perl\
Old versions I save as
perl-v5-3\
perl-v5-6\
When I want to go back I rename the root directory to
perl\
My environment for PERL always points to the PERL\ for everything.
Thanks
Bill Conrad
-----Original Message-----
From: Burchell, James [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 07, 2002 3:53 PM
To: '[EMAIL PROTECTED]'
Subject: running 2 versions of PERL on same machine
To all,
I am trying to run 2 versions of PERL on the same PC. Does anyone
have specifics on how to implement this ? Platform is NT4 SP 6.
===============================================================
C:\perl503\lib>perl -v
This is perl, version 5.003_07
<snip>
===============================================================
C:\Perl\bin>perl -v
This is perl, v5.6.1 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2001, Larry Wall
Binary build 631 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 17:16:22 Jan 2 2002
===============================================================
I have done the following steps in an attempt to get 2 environments:
1. I have renamed the directory of the older version of PERL to
c:\perl503
2. I have put explicit path names in the calling batch file to the
executable: c:\perl503\bin\perl.exe x:\script\thetest.pl
3. I have attempted (?) to work with the @INC variable with mixed
success. I can introduce new library paths into this variable like this:
use lib use lib "C:\\perl503\\lib\\win32\\";
... but I cannot delete an existing path.
4. I use the SU utility:
===============================================================
C:\USR\bin>su -?
SU for Windows NT v2.00 Aug 30 1996 22:46:13
(c) Copyright 1995, 1996 by Scott Field ([EMAIL PROTECTED])
Usage: su <User> "[cmdline]" [domain] [[Winsta\]Desktop] [options]
-cb do not create new console (do not use with redirected passwords)
-e disables environment preparation (Inherit parent environment)
-g force GUI option prompting with supplied commandline arguments
-l disables loading of the user registry hive (use .Default)
-v verbose output to stdout
-w do not wait on child (registry hive will remain loaded)
<snip>
===============================================================
and I do not specify any options. I only enabled OS specifics
so that the calling ID could successfully execute an SU event.
5. Here is the batch file I am executing; it is stripped of any
site specific data, but the code is the same.
C:\perl503\lib>type thetest.bat
@rem Script to run thetest.pl
set path=c:\perl503\bin;c:\winnt;c:\winnt\system32
c:\perl503\bin\perl.exe x:\scripts\thetest.pl
6. the test script thetest.pl looks like this:
===============================================================
# no lib "ALL .";
# use lib "C:\\perl503\\lib\\wisdot\\";
# use lib "C:\\perl503\\lib\\win32\\";
# use lib "C:\\perl503\\lib\\i386-win32\\";
# use lib "C:\\perl503\\lib\\";
# use lib ".";
for (@INC) {
printf "$_\n";
$i++;
}
===============================================================
7. Whenever I run this script with the
USE statements commented, I get this:
===============================================================
C:\perl503\lib>thetest
C:\perl503\lib>set path=c:\perl503\bin;c:\winnt;c:\winnt\system32
C:\perl503\lib>c:\perl503\bin\perl.exe x:\scripts\thetest.pl
C:\perl\lib\i386-win32
C:\perl\lib
.
C:\perl503\lib>
===============================================================
8. Whenever I run this script with the
USE statements uncommented, I get this:
===============================================================
C:\perl503\lib>thetest
C:\perl503\lib>set path=c:\perl503\bin;c:\winnt;c:\winnt\system32
C:\perl503\lib>c:\perl503\bin\perl.exe x:\scripts\thetest.pl
syntax error at C:\perl\lib/lib.pm line 3, near "use 5.005_64"
BEGIN failed--compilation aborted at x:\scripts\thetest.pl line 22.
C:\perl503\lib>
===============================================================
9. Note above that pathing suggests that the perl executable is
still looking at c:\perl\lib instead of c:\perl503\lib for
information.
How do I resolve this ? I have noted that changing the NEW perl
directory from C:\perl to some other name makes this problem go
away. I am, however trying to automate a proceedure. I had the
impression that I could tell perl where to look in its libraries
and also that I should be able to - via batch processing in the
command file- be able to restrict the path search.
Any input is appreciated.
Thanks,
James Burchell, MCP
______________________________________________________________
e-mail:
perl -e "print join('@', 'james.burchell','dot.state.wi.us')"
______________________________________________________________
infinite loop n. See loop, infinite.
Loop, infinite n. See infinite loop.
______________________________________________________________
Eschew obfuscation.
______________________________________________________________
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs