How about this heavy-handed approach. An automatic login script that sets up the perl environment for the users. Save it as /etc/perl_config.pl.
#!/usr/bin/perl -w use strict; # Validate current user die "Unknown user!" if (!$ENV{LOGIN}); # Load user configuration (from external file or from this script) my %config; while (<DATA>) { chomp; my ($user, $pref) = /(\w+)\s+(.*)\/perl/; $config{$user} = $pref; } # Find out the preferred perl version for this user # If user not seen in the config file, set to default # path to the latest version of perl my $path = $config{$ENV{LOGIN}} || "/usr/local/bin"; # Export the modified path for the user print "export PATH=$path:\${PATH}\n"; __DATA__ roger /usr/bin/perl james /usr/local/bin/perl thomas /usr/bin/perl peter /usr/perl/bin/perl
Note the format of the config file, to make it a bit easier to maintain and understand, I have chosen to put the full path to perl executable against each user (rather than path to bin directory), and the script will strip out the /perl bit before printing the modified path to STDOUT.

In user's login shell, just add the following:
eval $(/etc/perl_config.pl)
To the system /etc/profile or user's ~/.bash_profile.


In reply to Re: Upgraded perl but cant get to the new version by Roger
in thread Upgraded perl but cant get to the new version by Clunk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.