Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Perl5.8.0 and Perl5.8.8 coexists, how to use Perl 5.8.8

by marscld (Beadle)
on Dec 14, 2007 at 04:28 UTC ( #656981=perlquestion: print w/replies, xml ) Need Help??

marscld has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I've run into an issue with different version of Perl.Basically, the Solaris system owns Perl 5.8.0. For an request, a CGI::Session-4.20 is needed, but it can not be installed smoothly by perl Makefile.PL. However, a Perl5.8.8 is installed into a different directoy from Perl 5.8.0. Using /new_perl5.8.8_dir/usr/local/bin/perl Makefile.PL command will let the installation moving on. And CGI::Session-4.20 is installed successfully. The question is that a few cgi file would use the sesssion module, and it would need Perl5.8.8 as its running environment. How do I modify the code to let specified cgi files to invoke CGI::Session correctly ? Could you pls help on this ?
#!/usr/bin/perl use strict; use CGI qw/:standard/; use lib '/home/sdbadmin/PerlModule'; use CGI::Session; my $cgi_obj = new CGI(); my $session = new CGI::Session() or die CGI::Session->errstr;

Replies are listed 'Best First'.
Re: Perl5.8.0 and Perl5.8.8 coexists, how to use Perl 5.8.8
by Joost (Canon) on Dec 14, 2007 at 04:47 UTC
Re: Perl5.8.0 and Perl5.8.8 coexists, how to use Perl 5.8.8
by tachyon-II (Chaplain) on Dec 14, 2007 at 04:57 UTC

    Possibly the most convenient way to have multiple concurent versions of Perl available is to create a symlink so that /usr/bin/perl588 points to your Perl 5.8.8 install /new_perl5.8.8_dir/usr/local/bin/perl.

    ln -s /new_perl5.8.8_dir/usr/local/bin/perl /usr/bin/perl588 Then you just need to do #!/usr/bin/perl588 to use it in a script and perl588 Makefile.PL
    to do the install of CGI::Session into the 5.8.8 version of Perl. All your 5.8.0 stuff remains unchanged so nothing old should break.
      As someone who does a lot of sysadmin work, I like to keep the OS directories as sacrosanct as possible. I think using PATH and an alias (for interactive shell use) make more sense.
Re: Perl5.8.0 and Perl5.8.8 coexists, how to use Perl 5.8.8
by perlfan (Vicar) on Dec 14, 2007 at 05:29 UTC
    You can also put the perl you want first in your PATH, then use PERL5LIB to point to the proper module directories...this is how I manage multiple instances of perl, anyway.
Re: Perl5.8.0 and Perl5.8.8 coexists, how to use Perl 5.8.8
by ph0enix (Friar) on Dec 19, 2007 at 09:10 UTC
    I think that it will be enough to change first line to
    #!/new_perl5.8.8_dir/usr/local/bin/perl
    It is about six years ago when I work as Perl developer. I needed to test all new code for running with different versions of Perl. I've installed different perl versions to /opt/perl-${VERSION} so the system wide perl which was required for base system administration remain untouched. In addition I wrote a short application in C and save it as /usr/bin/perl_parallel. Perl_parallel read preferred Perl version from file .perl_version in user $HOME and executed script under correct Perl interpreter. There was also script use_perl for querying and updating .perl_version file. If someone is interested in the perl_parallel C source code, it can be found in C/C++ programming forum on server forum.builder.cz (page is in Czech).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://656981]
Approved by Thilosophy
Front-paged by Thilosophy
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2023-09-30 19:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?