Results 1 to 4 of 4

Thread: How to compile Perl

  1. #1

    How to compile Perl


    I am on Fedora core 5 32+ bit and want to learn Perl. All I have done so far is tried this command and installed Perl.

    yum install perl

    Do I need to download any thing else in order to compile and run Perl scripts from the command line itself? Can any one please give me a small script with instructions on how to compile it at the command line that I can test on my own? Thanks a lot guys..

  2. #2
    Join Date
    Jan 2007
    Adelaide, Australia


    #This is a comment that spans one line
    #Written by Mechdave as an example
    #Written on 16/5/2007
    #Use strict to restrict unsafe constructs in the language, the below imports all possible restrictions!
    use strict;
    #The below line will print Hello World to the console
    print "Hello World\n";
    #Print the question
    print "Hello my name is HAL, what is yours? ";
    #Now for user input
    my $user_name = <STDIN>;
    #Chomp removes the newline at the end of the line
    #Print entered name back to console
    print "Hello $user_name nice to meet you\n";
    #Script end
    The above should run on a standard perl install. As far as compiling it... you don't need to as Perl is a scripting language, all you need to do is to chmod +x your file to make it executable and then ./ or run it like this (you don't need to chmod +x it in this case):
    [mechdave@homeunix]$ perl

    There are plenty of Perl tutorials on the net I used this one to start with, also is very good for info on modules. is good too

    Have fun...

  3. #3

    Smile Perl Compilation

    U first see where the perl is installed in ur system...means path

    u have given"#! /usr/bin/perl" but some times automatically os takes this one also means "#! /usr/local/bin/perl", here "#!" means it is 'magic string', magic string means it tells the OS the path of the perl. so when ever u enter the path of the perl in perl script program first it will checks the path of ur installation of perl, so at that time in that path the Perl is not installed so u will get error automatically. So if u first check the path of the perl the command of checking the path of the perl "whereis perl or which perl" so u will get path where it is installed.

  4. #4
    Thanks a lot the code worked and thanks for telling me that I should be running it directly rather than compiling it first, what an idiot am I?

    I did have look at the site for tutorials and they seem quite good for beginners like me, but what I am after is an official documentation or reference of the language generally avaialble for other tools such as PHP, MySQL etc. Can you help me with this?


Similar Threads

  1. KDE does not compile C++ code
    By tech291083 in forum Redhat / Fedora
    Replies: 1
    Last Post: 04-30-2007, 12:06 PM
  2. Will my compile work?
    By kornp in forum General Chat
    Replies: 9
    Last Post: 11-26-2002, 02:48 AM
  3. php compile error
    By kemu in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 09-29-2002, 10:56 AM
  4. perl question from a perl newb
    By tolstoy in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 09-06-2002, 01:16 AM
  5. Anyone compile KDE 3.0?
    By t048 in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 05-30-2002, 02:58 PM


Posting Permissions

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