LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to install perl in unix (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-install-perl-in-unix-753768/)

pinga123 09-09-2009 02:29 AM

How to install perl in unix
 
Hi guys ,
This is my 2nd question in this forum.As i m completely new to this environment.I would like to know how to install perl on my linux machine.
I just know one thing about it that
" Perl interpreter is located at /usr/local/bin/perl."But i dont have perl directory at this location .
How do i go about it.

pinga123 09-09-2009 04:29 AM

Is my question is too basic to be asked here?

j_jerry 09-09-2009 04:37 AM

Quote:

Originally Posted by pinga123 (Post 3675562)
Is my question is too basic to be asked here?

No, really

hope this helps:

http://www.misc-perl-info.com/install-perl.html

If you have any doubts, please let us know

Also include which distro are you using when posting the question, it'll be helpful if you do

chrism01 09-09-2009 07:53 PM

Actually, /usr/bin/perl is the common place for it.
I'd definitely have a good look, as it's nearly always installed by default on Unix Linux these days.
Many sysadmin scripts are written in it.
As said, if you tell us your distro & version, we can prob tell you where it is.
Alternatively try these cmds

whereis perl
which perl
locate perl
find / -name perl -type -print 2>/dev/null # need to be root for this one

pinga123 09-09-2009 10:19 PM

I m using linux gnu

output of command whereis perl
perl: /usr/bin/perl /usr/share/man/man1/perl.1.gz
but when i tried to access /usr/bin/perl it says not a directory what to do?
[root@test ~]# cd /usr/bin/perl
-bash: cd: /usr/bin/perl: Not a directory
You have new mail in /var/spool/mail/root
[root@test ~]# cd /usr/bin/perl
-bash: cd: /usr/bin/perl: Not a directory

now what to do?

Tinkster 09-09-2009 10:25 PM

/usr/bin/perl is the executable, not a directory

Code:

/usr/bin/perl -v

This is perl, v5.10.0 built for x86_64-linux-thread-multi

Copyright 1987-2007, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


Wim Sturkenboom 09-09-2009 10:36 PM

As Tinkster said.

Two little notes:
1)
Your title reads unix but your question reads linux. You might have chased some possible help away by talking about unix in the title. Try to be accurate in your posts.
2)
Please don't bump your post within 24 hours. Give it time to go around the world; when you're awake, the people who might know the answer might be sleeping so you don't win anything.
This forum has an automatic bump for unanswered posts for two days. So by answering your own post you did loose that option.

chrism01 09-10-2009 12:27 AM

As said, /usr/bin/perl is the executable file, not a dir, so you can't cd to it. Just cd to /usr/bin .
Also,
Quote:

I m using linux gnu
tells us nothing. GNU/Linux is the proper full name for Linux, but doesn't tell us which distro eg Centos, Fedora, Ubuntu etc.
Look in the /etc dir (as root) for a file with 'release' as part of it's name and use the cat cmd

cat /etc/*release*

and post the contents.

At least you now know you've got Perl installed.
PS you'll find these links handy:
http://perldoc.perl.org/
http://www.perlmonks.org/?node=Tutorials


All times are GMT -5. The time now is 08:51 PM.