Operating System - HP-UX
1753435 Members
4537 Online
108794 Solutions
New Discussion юеВ

/usr/bin/perl linked to /opt/perl/bin/perl

 
Delecole
Frequent Advisor

/usr/bin/perl linked to /opt/perl/bin/perl

Hi There !!

I'm trying to find out why on my HP-UX 11i machine, the /usr/bin/perl has a symbolic link to /opt/perl/bin/perl.

I see only that on one of my machine, and all the other machines do not have the symbolic link.

It seems like the link has been created when the HP-UX has been installed (As per the swagent.log dates I find), but I'm looking for some more installation logs that could tell me really at which point the link has been created.

Many Thanks !!
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor

Re: /usr/bin/perl linked to /opt/perl/bin/perl

Hi:

The latest (5.8.8) Perl depot from HP-UX specifies '/opt/perl' as the installation directory for Perl. However, for convenience, and conformance, a symbolic link is created from '/usr/bin/perl' as noted, during Perl's installation.

Formerly, one had to create one's own symbolic link from '/usr/bin/perl'.

Regards!

...JRF...
Delecole
Frequent Advisor

Re: /usr/bin/perl linked to /opt/perl/bin/perl

What I see on my system is that the symbolic link with /usr/bin/perl is created on my system.

do you mean that is has been created by someone, or by the perl installation ??

If it has been created by the perl installation, is there a log file / script where I can see it created the link ?

Many thanks, we're on the good way !
inventsekar_1
Respected Contributor

Re: /usr/bin/perl linked to /opt/perl/bin/perl

Delecole,

UNIX (or HP-UX) file system hierarchy is the answer.

users applications installation directory will be under /opt/application_name

and to maintain the PATH for the executables, the applications(or users) will create the symbolic link in /usr/bin/

understanding the unix file system hierarchy is interesting. try that sometime.

Be Tomorrow, Today.
inventsekar_1
Respected Contributor

Re: /usr/bin/perl linked to /opt/perl/bin/perl

perl installation itself created that link.

and u cant find that in the log file(i think)

u can refer the perl installation guides.

check the owener of the /usr/bin/perl
it is bin. not root or somebody.
so that link is created while installing perl

Sekar
Be Tomorrow, Today.
Steven E. Protter
Exalted Contributor

Re: /usr/bin/perl linked to /opt/perl/bin/perl

Shalom,

Summary answer:

1) Convenience.
2) Version control of what perl is used.

The average system may have many releases of perl. It may be possible to consolidate using soft links and run fewer versions of perl.

This can be done by an install process. I often did it manually with the ln -s command.

Doing it this way negates the need to edit a pile of scripts.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: /usr/bin/perl linked to /opt/perl/bin/perl

Hi (again):

Since SD-UX installed the Perl, you need only look in the configure script. See, in this case:

# /var/adm/sw/products/Perl5-64/pfiles/configure

# /var/adm/sw/products/Perl5-32/pfiles/configure

Regards!

...JRF...
Tim Nelson
Honored Contributor

Re: /usr/bin/perl linked to /opt/perl/bin/perl

THe base hpux has almost always included a stripped perl binary usually found in /usr/contrib/bin. If no additional perl packages were installed you would have probably seen /usr/bin/perl linked to /usr/contrib/bin/perl. With the addition of the additional perl package, the installation changes the link to /opt/perlX.X/bin/perl.

Java typically works the same way /usr/bin/jre typically is a link to /opt/javeX.X/jre/bin or something.

The use of the link in /usr/bin could be a transitional support link. Older software with hard codes can find the perl binary with out a programming change.



A. Clay Stephenson
Acclaimed Contributor

Re: /usr/bin/perl linked to /opt/perl/bin/perl

Generally, it's always a good idea to symbolically link the "real" version of Perl to /usr/bin/perl because it is very common practice to use the "shbang" line as the first line of a Perl script:

e.g.
#!/usr/bin/perl
or better still
#!/usr/bin/perl -w

Remember, UNIX has no notion of file extensions so "myfile.pl" only gets executed as a perl script either if the "shbang" line is correct or if the script is invoked as an argument to perl.
e.g. "perl myfile.pl"

If this symbolic link were not in place then you would need to modify your Perl scripts each time the Perl directory were moved. Using the symbolic link means that you make one change (to the link) when Perl is installed elsewhere and nothing else has to change. Thus, whether or not the Perl install routines creates this link, it's a good idea to have it.
If it ain't broke, I can fix that.
rariasn
Honored Contributor

Re: /usr/bin/perl linked to /opt/perl/bin/perl

ll /usr/bin/perl
lrwxr-xr-x 1 root sys 18 Mar 29 09:44 /usr/bin/perl -> /opt/perl/bin/perl

#ll -d /opt/perl*
lrwxr-xr-x 1 root sys 12 Mar 29 09:44 /opt/perl -> /opt/perl_32
dr-xr-xr-x 7 root root 1024 Mar 29 09:39 /opt/perl_32
dr-xr-xr-x 7 root root 1024 Mar 29 09:44 /opt/perl_64

/usr/bin/perl -v

This is perl, v5.8.7 built for PA-RISC1.1-thread-multi
(with 8 registered patches, see perl -V for more detail)

Copyright 1987-2005, Larry Wall

rgs

ran