Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Installing a Perl ???

  1. #1
    Join Date
    Mar 2006
    Location
    Dallas, TX
    Beans
    367
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Installing a Perl ???

    Someone please help I want to learn how to program with Perl, but I can't seem to get it installed on my computer ( I am running Ubuntu Breezy ) I downloaded the tar.gz from the perl website but I cant get it to install. Well, I really don't know where to go from there. Can anyone point me in the right direction on how to install the Perl? Any advice will help. thank you.
    Hello..my name is Nono
    Linux User #415998

  2. #2
    Join Date
    Aug 2006
    Location
    Belgium
    Beans
    Hidden!
    Distro
    Xubuntu 8.04 Hardy Heron

    Re: Installing a Perl ???

    what's wrong with
    Code:
    sudo apt-get install perl
    ?

  3. #3
    Join Date
    Mar 2006
    Location
    Dallas, TX
    Beans
    367
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Installing a Perl ???

    You mean that is all I have to do? Man, I was just going off of what the book was asking. (Beginning Perl) is the name of the book and it asked me to download it from the Perl Website. I'll try that today and see if it installs. Thanks.
    Hello..my name is Nono
    Linux User #415998

  4. #4
    Join Date
    Aug 2006
    Location
    Belgium
    Beans
    Hidden!
    Distro
    Xubuntu 8.04 Hardy Heron

    Re: Installing a Perl ???

    Yeah, I remember reading some perl documentation some years ago where it stated that you'd better get your own version of perl and compile it but that's entirely not needed (especially not for beginning programmers). There are even huge chances that it is already installed on you system.

    have you already tried to type perl in a prompt ?

  5. #5
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Installing a Perl ???

    umm, perl should already be installed ...

    try 'perl -v' or 'which perl'

  6. #6
    Join Date
    Mar 2006
    Location
    Dallas, TX
    Beans
    367
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Installing a Perl ???

    I typed perl -v and it gave the following information:

    neogreen@ubuntulinux:~$ perl -v

    This is perl, v5.8.7 built for i486-linux-gnu-thread-multi
    (with 1 registered patch, see perl -V for more detail)

    Copyright 1987-2005, 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.

    I then typed which Perl and I got the following information:

    neogreen@ubuntulinux:~$ which perl
    /usr/bin/perl

    I guess this mean I have it and it is located in /usr/bin/perl
    Hello..my name is Nono
    Linux User #415998

  7. #7
    Join Date
    Mar 2006
    Location
    Dallas, TX
    Beans
    367
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Installing a Perl ???

    I see that I also have Anjuta installed on my Ubuntu 5.10. Can I use Anjuta to write programs with Perl?
    Hello..my name is Nono
    Linux User #415998

  8. #8
    Join Date
    Oct 2005
    Location
    Jacksonville, FL
    Beans
    29,420

    Re: Installing a Perl ???

    You can use any text editor you want to write your program for perl. Heck, you can even use vi if you feel lucky!!! Otherwise, use gedit or nano...
    In the world of Linux, who needs Windows and Gates...

    Got most of my golden beans at an auction on eBay (with a couple of free drinks).

  9. #9
    Join Date
    Mar 2006
    Location
    Dallas, TX
    Beans
    367
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Installing a Perl ???

    Okay, so it really doesn't matter as long as it is a text editor. I like nano it seems a whole lot easier to use. So after I write a program in Perl, I should save it as a pl file extention and then run it. Will Ubuntu compile it for me?
    Hello..my name is Nono
    Linux User #415998

  10. #10
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Installing a Perl ???

    umm, perl is not exactly compiled as C is.

    when you write a perl script

    for example:
    Code:
    #!/usr/bin/perl
    
    print "Hello World\n";
    it doesn't matter how you save it, but don't forget to make it executable:
    Code:
    chmod +x perlscript.pl
    that's it there is to it.

    small lesson on the 'she bang' notation (ricki martin so stole the song from Unix) ...

    anyways, that first line is special, basically, it tells the shell which interpreter to use for the rest of the script.

    C is compiled at the developer end and nothing special (besides the same environment (OS/CPU)) is required to run the program.

    Java is compiled at the developer end but the user must have the virtual machine installed.

    Perl is is compiled (into bytecode, just like java) at the end-user end and the end-user must have perl interpreter installed.

    Hope that explains things.

    EDIT:
    as for using nano, I suggest you google 'vitutor.' it is a simple text file which teaches you how to use vi/vim (you use vim to actually read it) by actually doing things to the file.

    I tend to use Anjuta because pressing the F3 key runs the scripts while F9 only runs the script through the interpreter with -c option (compile but not execute, basically, check for syntax).

    Yet another thing, while perl can be easy and fun in the very beginning, it can be very intimidating when you start using hashes of arrays of hashes of arrays of hashes (and onto infinity), of course there is pretty much no practical example where you do stuff like that.
    Last edited by slavik; October 16th, 2006 at 05:37 AM.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •