Serge
Serge

Reputation: 3775

How to install perl to /usr/local/bin

I have a CD with a bunch of perl scripts, using /usr/local/bin/perl shebang. Yet on my machine perl is on /usr/bin .

Can I just copy perl file or should have some more sophisticated install, like compiling from the source?

Perl 5.22, Ubuntu 16.04

Upvotes: 0

Views: 1078

Answers (1)

Tanktalus
Tanktalus

Reputation: 22294

The simplest solution that is likely to work for most cases is just to create a symlink in /usr/local/bin pointing to ../../bin/perl. Another alternative is to use perl (or awk or sed) to change the first line of your files to point at the right place. A bit more work, but not really hard.

If you need a private perl for some reason, and this isn't really very abnormal for perl shops, much like Java shops will have multiple JVMs floating around, or C# shops will have multiple levels of .NET / .NETCore floating around, then installing your own copy from source doesn't take a whole lot of work, though, even here, I'd suggest installing to somewhere else, and then creating the symlink you require so as to make it easier to upgrade and downgrade as required.

Upvotes: 4

Related Questions