[Pdx-pm] [csieh at fnal.gov: Re: Horribly Broken RHEL5/SL5 Perl]

Erik Hollensbe erik at hollensbe.org
Wed Aug 27 02:05:22 PDT 2008


On Tuesday 26 August 2008 16:40:10 Keith Lofstrom wrote:
> Good stuff!  Everyone agrees with maintaining 2+ Perls, and I
> now understand the wisdom of that.   I'm not so convinced by
> the env approach, or using /opt for the alternate Perl.  Others
> point to writing the scripts with #!/usr/local/bin/perl .   Since I
> am not a developer, merely a user crawling through no-man's-land
> between the Red Hat and Perl trenches, I hope I can come up with
> something that is easy to maintain and understand without getting
> my butt shot off by third-party cybersociopaths as I crawl along.

Keith, another (perhaps better for your situation, perhaps not) alternative is 
how FreeBSD approaches this problem.

At least in older versions of FreeBSD, there was a system perl that was 
required for system interaction and that version was fixed. If you wanted a 
newer perl, you had to install it from ports.

However, as you might encounter by using location-specific shebangs (as 
opposed to leveraging the path via /usr/bin/env), lots of vendor scripts use 
/usr/bin/perl as if it's always supposed to be there. On older versions (as 
in, two years ago) of FreeBSD, that meant you were using 5.005, which is just 
over 10 years old. Probably not what you want. Also, it may be the case that 
editing every perl script you install outside of CPAN is taking 'time 
consuming' to a whole new level.

Anyways, the FreeBSD guys came up with a little selector tool called 
'use.perl', which selected what /usr/bin/perl pointed at in certain 
situations. I wish I could give you exact details of the implementation, but 
it's probably worth looking into should you run into this problem. It would 
probably require repackaging (which is safe as long as you preserve the 
modifications and build process) your system perl to muck with the path of the 
"real" perl binary, and installing a script or symlink in it's place. If you 
have many machines to maintain, this may be the simplest route, as much as it 
may not read like it.

HTH,

-Erik


More information about the Pdx-pm-list mailing list