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]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to