473,226 Members | 1,601 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

accessing different versions of perl

I would like to run the same script on two different platforms. The
directory in which the script(s) will be stored is common to the two
platforms. (I see the same directory contents regardless of which
platform I use to access the directory.)

Platform 1: perl is installed in /tps/bin/perl. CPAN modules are available
Perl is also installed in /usr/bin/perl Platform 1, but the modules are
not accessible with this version.

Platform 2: perl is installed only in /usr/bin/perl. Modules are not
installed.

The script still can do a lot of the desired functionlity without the
modules, and with either version of perl, so it is useful on both platforms.

Making two separate scripts with different names (stored in the same
directory) would solve the problem (one script accesses /tps/bin/perl
and requires the modules; the other script accesses /usr/bin/perl and
does not require the modules), but I don't want the user to have to
enter two different command lines depending on which platform they are on.

I tried writing a csh script that calls the appropriate version after
checking to see if /tps/bin/perl is installed or not on the host that
executes the csh script. The csh script appears to call the correct
version of the perl script, but none of the perl output that should go
to the screen was displayed.

What's the best way to approach this problem?
Or, if the csh approach is best, where did my STDOUT output go?

(Getting perl installed uniformly with the required modules across both
platforms isn't an option at this time, and I don't want to give up the
added functionality that is available in the /tps/bin/perl version that
has the modules available.)

Julia Bell

Jul 19 '05 #1
1 4650
dw

"Julia Bell" <ju********@jpl.nasa.gov> wrote in message
news:3F**************@jpl.nasa.gov...
.....

Platform 1: perl is installed in /tps/bin/perl. CPAN modules are available Perl is also installed in /usr/bin/perl Platform 1, but the modules are
not accessible with this version.

Platform 2: perl is installed only in /usr/bin/perl. Modules are not
installed.
..... What's the best way to approach this problem?
Or, if the csh approach is best, where did my STDOUT output go? .....
what does your csh script look like?

(Getting perl installed uniformly with the required modules across both
platforms isn't an option at this time, and I don't want to give up the
added functionality that is available in the /tps/bin/perl version that
has the modules available.)

.....

If your own directory is in a common place how about creating a link on each
machine to the correct path....
ln -s /tps/bin/perl ~/perl # on platform 1
ln -s /usr/bin/perl ~/perl # on platform 2
then use
#!/home/id/perl
in your scripts. This should avoid starting up an intermediate shell.

I don't have csh, but this works for me with sh:
#!/bin/sh
if [ -x /tps/bin/perl ]
then exec /tps/bin/perl -x $0 ${1+"$@"}
else exec /usr/bin/perl -x $0 ${1+"$@"}
fi

#!/usr/bin/perl -w
print "$0: running\n";
print "ARGV:\n";
for (my $x = 0; $x<@ARGV; $x++) {
printf "%3d: %s\n", $x, $ARGV[$x];
}

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Andrae Muys | last post by:
Found myself needing serialised access to a shared generator from multiple threads. Came up with the following def serialise(gen): lock = threading.Lock() while 1: lock.acquire() try: next...
0
by: Matt Johnson | last post by:
Hello, Recently we made some fairly significant upgrades...going from Solaris 5.6 to Solaris 5.8 (Solaris 8). Along with this, we decided to upgrade from perl 5.005_03 directly to perl 5.6.0. ...
3
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then...
3
by: Lauren Wilson | last post by:
Can someone point me to the best concentration of info on manipulating an MDB file via VBA and HTTP? Need to do all the standard stuff for a flat-file database: locate and retrieve records by ID...
37
by: pochartrand | last post by:
Hello, Is there a way to manipulate or at least read the pseudo-class of an element ? I know the style attribute can be accessed and gives the CSS properties for a particular element....
0
by: learnet | last post by:
Hi, I have a question about using different versions of same assembly from GAC.... I have created a assembly "testlib" and created a strong name for that assembly. Installed the assembly in...
5
by: feli.hp | last post by:
Hello all, Imaybe someone can help me with this question. Is there a direct way of accessing an object instance, if all I know is the value of one of its attributes? The object is part of a...
4
by: martin99 | last post by:
Hi, I know that Clickbank does not have an api utility (unlike Paypal etc) so it hard to get the data back to an application to check sales etc I see a POST in a PERL user group and they got...
2
by: preityrao | last post by:
Hi, I am new to perl and was trying to write a perl program witha UI. i.e. I have written a html form which invokes a perl program to execute and to print back the data selected in the form. ...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.