Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: multi version perl

by salva (Abbot)
on Jun 06, 2013 at 08:49 UTC ( #1037413=note: print w/replies, xml ) Need Help??


in reply to multi version perl

Don't do that, it would break almost anything using the system perl.

Also, check perlbrew, it allows you to install alternative perl versions and switch between them easyly.

Replies are listed 'Best First'.
Re^2: multi version perl
by space_monk (Chaplain) on Jun 06, 2013 at 09:50 UTC
    You should not redirect /usr/bin/perl for the reasons explained above, but you CAN reasonably redirect /usr/local/bin/perl to your new version of Perl and put that as the path to Perl in the magic perl start line.

    You should also arrange the path search for non-admin users to pick up the local perl instead of the system Perl.

    e.g. in /etc/profile or similar
    export PATH=/usr/local/bin;$PATH

    You may need to add/change other environment variables as well (PERL5INC, PERL5LIBS..)

    If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)
      You should also arrange the path search for non-admin users to pick up the local perl instead of the system Perl

      Why?

      I can see that would make sense in certain environments, but I don't see it as a general rule.

        Presumably because other users will be using the scripts written for the local Perl version. (Though given it's Ubuntu I'm betting against there being other users ;)

        print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

        Well IIRC /usr/local/bin will normally precede /usr/bin in the path search order for non-admin users anyway, so I'm not proposing anything radical here.

        You should be encouraging users to use the installed perl as a default, not the system perl which should be only there to support existing admin tasks

        If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037413]
help
Chatterbox?
[abner]: yes. i am familiar with mysql but ignorant about how to get around the fact that placeholders can only represent single scalar values.
[abner]: my $sth = $dbh->prepare(' SELECT * FROM charge WHERE cpt = ?') or die "Couldn't prepare statement: " . $dbh->errstr;
[abner]: what if i want SELECT * FROM charge WHERE col1 = x and col2 = y?
[atcroft]: abner: So you are wanting to do something like my $sth = $dbh->prepare(' SELECT * FROM charge WHERE col1 = ? and col2 = ?;'); $sth->execute(' asdf', 'asdw');?
[atcroft]: (Full disclosure: I may have the idea right but small typographical errors, so please test any code I suggest. :) )

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2017-01-24 03:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (202 votes). Check out past polls.