Providing a Link to Perl

I was wondering how I can create a link to the perl interpreter.

On my old machine perl is at: user/local/bin/perl
and my new machine has it at: user/bin/perl

I don't want to have to change all my cgi scripts when I move them to the new server. Can I just create a new directory (user/local/bin/perl) and provide some sort of link to perl?



If you want to create links, there are numerous ways to do it. For example:

If your original perl distribution is at:


and you want to link it to /usr/local/perl

just do this:

ln -sf /usr/local/lib/perl /usr/local/perl

(note that /usr/local/perl SHOULD NOT EXIST before
the command above).

This will create a symbolic link from /usr/local/lib/perl
(a directory) to the /usr/local/perl directory

You can also use symbolic links on individual files.

thanks for the quick reply.

does this mean that perl scripts which have the first line set to #!/usr/local/perl

will still work even though perl actually resides at /usr/local/lib/perl as long as I create a symbolic link between the two directories?

Yes. You can use the 'same magic' as before as you show in your post.

thanks a bunch. i'll give it a shot...