Re: Question regarding use of multiple Perl versions

2006-12-01 Thread Ken Foskey
On Thu, 2006-11-30 at 11:40 -0500, Hotz, Harry wrote:
>   I have a new AIX 5.3 server that comes with a default Perl 5.82.
> I have a DB2 programmer that has scripts from an old AIX 4.3 server that
> used Perl 5.005_03. He will have to rewrite his scripts to use the new
> Perl and asked me to install the old version side by side. I did so in a
>  directory and compiled it successfully. He took the user
> account under which the scripts are executing and added a path to the
> profile to point to the location of the old Perl but when he uses it and
> does a perl -version he still gets a return of the 5.8 version. He feels
> this is a guarantee that his scripts will be hitting the wrong version
> and wants to know why he cannot version query the old Perl. 
> 
>   My question is it even possible to successfully work with two

PATH=/usr/lpp/oldperl:$PATH

rather than the normal

PATH=$PATH:/usr/lpp/oldperl

then he prefixes every command with `perl 

Re: Question regarding use of multiple Perl versions

2006-11-30 Thread Tom Phoenix

On 11/30/06, Hotz, Harry <[EMAIL PROTECTED]> wrote:


I have a new AIX 5.3 server that comes with a default Perl 5.82.
I have a DB2 programmer that has scripts from an old AIX 4.3 server that
used Perl 5.005_03. He will have to rewrite his scripts to use the new
Perl


Probably not much, in my experience. But he's had since the year 2000
to adapt to newer Perl versions than that. Is he having trouble
getting started? What troubles is he having? Anything we folks on the
Internet haven't seen and solved already?


but when he uses it and
does a perl -version he still gets a return of the 5.8 version.


(He really means to do 'perl -v'; see perlrun.) That's the first perl
binary his shell is finding, so it's probably the first one found
among his $PATH directories. His shell's documentation should explain
how to automatically set the $PATH whenever he logs in, say. Then, of
course, he would have to log in again to use the new $PATH.


He feels
this is a guarantee that his scripts will be hitting the wrong version
and wants to know why he cannot version query the old Perl.


If he wants the old Perl, he can ask for it on the command line

 $ /home/wherever/usr/lpp/oldperl -v

or on the shebang line:

 #!/home/wherever/usr/lpp/oldperl

In fact, instead of calling it "oldperl", you could include the
version number directly in the path. This makes it easier to see when
a program is depending upon a particular version, so it's good for
maintenance, too.

To settle the arguments about which perl binary you've actually
invoked by whichever method, your programmer should use Perl's
oddly-named $] variable. See perlvar:

 print "Perl version: $]\n";


My question is it even possible to successfully work with two
versions of Perl..5.005 and 5.8 on the same server.


Sure. There are going to be issues, of course; but maintaining two
versions of Perl will generally require much less than twice the
effort than needed to maintain just the older version of Perl.


I do plan to insist he rewrite for the new version
soon but if I could do anything for him quickly to make his scripts use
the old version I will.


It sounds as if you've done what you need to do, probably; short of
licensing his source so you can get the bitrot cleared away some
afternoon. :-)

Good luck with it!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Question regarding use of multiple Perl versions

2006-11-30 Thread Derek B. Smith

--- Jay Savage <[EMAIL PROTECTED]> wrote:

> On 11/30/06, Hotz, Harry <[EMAIL PROTECTED]> wrote:
> >
> > I have a new AIX 5.3 server that comes
> with a default Perl 5.82.
> > I have a DB2 programmer that has scripts from an
> old AIX 4.3 server that
> > used Perl 5.005_03. He will have to rewrite his
> scripts to use the new
> > Perl and asked me to install the old version side
> by side. I did so in a
> > usr/lpp/oldperl directory and compiled it
> successfully. He took the user
> > account under which the scripts are executing and
> added a path to the
> > profile to point to the location of the old Perl
> but when he uses it and
> > does a perl -version he still gets a return of the
> 5.8 version. He feels
> > this is a guarantee that his scripts will be
> hitting the wrong version
> > and wants to know why he cannot version query the
> old Perl.
> >
> > My question is it even possible to
> successfully work with two
> > versions of Perl..5.005 and 5.8 on the same
> server...and I don't mean
> > just different modules. I saw that there is a use
> command to access
> > different module versions but I don't know if that
> applies to using the
> > whole Perl version. I do plan to insist he rewrite
> for the new version
> > soon but if I could do anything for him quickly to
> make his scripts use
> > the old version I will.
> >
> 
> It's absolutely possible. In fact, it's recommended
> when upgrading.
> 
> The likely culprit here is the "bang path." He can
> alias the shell
> variable, but if the first line of the script is
> still
> 
> #!/usr/bin/perl
> 
> then /usr/bin/perl is the Perl that will be used.
> What he needs to do
> is go into the scripts that he's worried about and
> point them to
> 
>#!/usr/lpp/oldperl/perl5.005_03
> 
> ...or wherever the actual executable for the old
> Perl is hiding. It
> sounds like a lot of work, but he can automate it.
> 
> HTH,
> 

Also check that users PATH variable.
echo $PATH

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Question regarding use of multiple Perl versions

2006-11-30 Thread Jay Savage

On 11/30/06, Hotz, Harry <[EMAIL PROTECTED]> wrote:


I have a new AIX 5.3 server that comes with a default Perl 5.82.
I have a DB2 programmer that has scripts from an old AIX 4.3 server that
used Perl 5.005_03. He will have to rewrite his scripts to use the new
Perl and asked me to install the old version side by side. I did so in a
usr/lpp/oldperl directory and compiled it successfully. He took the user
account under which the scripts are executing and added a path to the
profile to point to the location of the old Perl but when he uses it and
does a perl -version he still gets a return of the 5.8 version. He feels
this is a guarantee that his scripts will be hitting the wrong version
and wants to know why he cannot version query the old Perl.

My question is it even possible to successfully work with two
versions of Perl..5.005 and 5.8 on the same server...and I don't mean
just different modules. I saw that there is a use command to access
different module versions but I don't know if that applies to using the
whole Perl version. I do plan to insist he rewrite for the new version
soon but if I could do anything for him quickly to make his scripts use
the old version I will.



It's absolutely possible. In fact, it's recommended when upgrading.

The likely culprit here is the "bang path." He can alias the shell
variable, but if the first line of the script is still

   #!/usr/bin/perl

then /usr/bin/perl is the Perl that will be used. What he needs to do
is go into the scripts that he's worried about and point them to

  #!/usr/lpp/oldperl/perl5.005_03

...or wherever the actual executable for the old Perl is hiding. It
sounds like a lot of work, but he can automate it.

HTH,

-- jay
--
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.downloadsquad.com  http://www.engatiki.org

values of β will give rise to dom!


Question regarding use of multiple Perl versions

2006-11-30 Thread Hotz, Harry

I have a new AIX 5.3 server that comes with a default Perl 5.82.
I have a DB2 programmer that has scripts from an old AIX 4.3 server that
used Perl 5.005_03. He will have to rewrite his scripts to use the new
Perl and asked me to install the old version side by side. I did so in a
usr/lpp/oldperl directory and compiled it successfully. He took the user
account under which the scripts are executing and added a path to the
profile to point to the location of the old Perl but when he uses it and
does a perl -version he still gets a return of the 5.8 version. He feels
this is a guarantee that his scripts will be hitting the wrong version
and wants to know why he cannot version query the old Perl. 

My question is it even possible to successfully work with two
versions of Perl..5.005 and 5.8 on the same server...and I don't mean
just different modules. I saw that there is a use command to access
different module versions but I don't know if that applies to using the
whole Perl version. I do plan to insist he rewrite for the new version
soon but if I could do anything for him quickly to make his scripts use
the old version I will.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]