Results 1 to 5 of 5

Thread: Perl

  1. #1
    Join Date
    Sep 2009
    Location
    New Jersey
    Beans
    272
    Distro
    Ubuntu 10.04 Lucid Lynx

    Perl

    Hello everyone. I am planning on doing some Perl and Python coding since they are going to be the native languages since I am deleting Windows. I need help getting to Perl though. I know Python has a Shell which I am using now to program, but I don't know of anything like that for Perl. I am learning Perl and using SciTE to edit the programs, but, when I try to execute them in terminal with the commands below it gives me errors. I will paste all the information below.

    TestPerl Program coding:

    Code:
    #!usr/bin/perl
    
    print "Hello!"
    Terminal Conversation:

    Code:
    tommy@ubuntu:~$ chmod +x /home/tommy/Desktop/TestPerl
    tommy@ubuntu:~$ ./TestPerl
    bash: ./TestPerl: No such file or directory
    tommy@ubuntu:~$ /home/tommy/Desktop/TestPerl
    bash: /home/tommy/Desktop/TestPerl: usr/bin/perl: bad interpreter: No such file or directory
    I marked the file as executable, but when I hit Run In Terminal it just opens and closes really fast.

    Thanks,
    Tom

  2. #2
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: Perl

    You've missed out the slash before usr.

    The first line should be:

    Code:
    #!/usr/bin/perl
    Also, to run the script from a terminal with ./TestPerl, you first need to navigate to your Desktop folder (since that's where it's saved) with
    Code:
    cd ~/Desktop
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

  3. #3
    Join Date
    Sep 2009
    Location
    New Jersey
    Beans
    272
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Perl

    Ok, that's fixed, much thanks. But I have another question, how do I take user input?

  4. #4
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: Perl

    I've not used perl for much, but this tutorial may help you: http://www.wellho.net/resources/ex.p...=p103/greeting
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

  5. #5
    Join Date
    Sep 2009
    Location
    New Jersey
    Beans
    272
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Perl

    Quote Originally Posted by WorMzy View Post
    I've not used perl for much, but this tutorial may help you: http://www.wellho.net/resources/ex.p...=p103/greeting
    Thank you guys sooo much! All fixed . *Marks thread as solved*.

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
  •