Find the answer to your Linux question:
Results 1 to 7 of 7
Hi all, I having problem compile my perl file either using 1 of this command Code: test.pl or Code: ./test.pl it gives me an error of Permission denied But i ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Dec 2005
    Location
    Singapore
    Posts
    234

    perl compile


    Hi all,
    I having problem compile my perl file either using 1 of this command
    Code:
    test.pl
    or
    Code:
    ./test.pl
    it gives me an error of
    Permission denied
    But i can view the file using the vim editor

    perviosly i made changes in order to install the NetBeans IDE
    Code:
    chmod +x your_binary_executable
    Proper Planing is a way of success

  2. #2
    Linux Guru bryansmith's Avatar
    Join Date
    Nov 2004
    Location
    /Ontario/Canada
    Posts
    2,619
    What happens if you do:
    Code:
    perl test.pl
    Bryan
    Looking for a distro? Look here.
    "There can be no doubt that all our knowledge begins with experience." - Immanuel Kant (Critique of Pure Reason)
    Queen's University - Arts and Science 2008 (Sociology)
    Registered Linux User #386147.

  3. #3
    Linux Newbie
    Join Date
    Dec 2005
    Location
    Singapore
    Posts
    234
    Quote Originally Posted by bryansmith
    What happens if you do:
    Code:
    perl test.pl
    Bryan
    Ok, since i have the perl compiler in my machine, if i install the php again, will it be any conflict?
    Proper Planing is a way of success

  4. #4
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    ...what?

    You can have both PHP and Perl installed simultaneously...

    Also, the reason for your problem is this:

    In Linux, we do not have file associations that apply systemwide. Your file manager may have them, but the commandline does not.

    Therefore, to run a Perl file, you need to specify what you're running with. There are two ways to do this:

    1) Declare the interpreter on the commandline. That is:
    Code:
    perl foo.pl
    2) Use the sh-bang line of the file to declare an interpreter. This is the first line of the file, and is done as follows:
    Code:
    #!/usr/bin/perl
    <rest of file>
    Also, because we don't use file associations, you don't need to end your Perl scripts with ".pl". You can have a file just called "foo", and as long as it is called with "perl" or has a sh-bang line, you'll be fine.

  5. #5
    Linux Newbie
    Join Date
    Dec 2005
    Location
    Singapore
    Posts
    234
    I have perl installed and i am able to ping my localhost, but why i type http://localhost at my browser it give me an error of :
    “localhost” refused the connection.

    The server may be busy or you may have a network connection problem. Try again later.

    There may be an old version of the page you wanted:


    * in the Google Cache

    * in the Internet Archive
    I dun have my PHP installed, in that case what the localhost refering to?
    Proper Planing is a way of success

  6. #6
    Linux Guru bryansmith's Avatar
    Join Date
    Nov 2004
    Location
    /Ontario/Canada
    Posts
    2,619
    Do you have a webserver such as Apache setup? If you do, give http://127.0.0.1 a try.

    Bryan
    Looking for a distro? Look here.
    "There can be no doubt that all our knowledge begins with experience." - Immanuel Kant (Critique of Pure Reason)
    Queen's University - Arts and Science 2008 (Sociology)
    Registered Linux User #386147.

  7. #7
    Linux Newbie
    Join Date
    Dec 2005
    Location
    Singapore
    Posts
    234
    Quote Originally Posted by bryansmith
    Do you have a webserver such as Apache setup? If you do, give http://127.0.0.1 a try.

    Bryan
    it gives the same error as http://localhost
    Proper Planing is a way of success

Posting Permissions

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