New Language Simple Problem...I hope.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ChaseCox
    Contributor
    • Nov 2006
    • 293

    New Language Simple Problem...I hope.

    So this is my first time in the Perl forums, so greetings to all. I have recently decided to learn Perl since I have heard so many good things. The only problem is that I can not get my code to work. I am using Mac OS 10

    Here is the code (taken line for line from the book Learning Perl)

    #!/usr/bin/perl
    print "Hello, world!\n";

    I saved this file as hello.pl

    I then went to the terminal and navigated to the appropriate directory and used the following lines:

    chase:Perl_Lear ning_Perl chase$ chmod +x hello.pl
    chase:Perl_Lear ning_Perl chase$ ./hello.pl


    and the error I received was:

    ./hello.pl: line 1: {rtf1ansiansicp g1252cocoartf94 9cocoasubrtf330 : command not found
    ./hello.pl: line 2: syntax error near unexpected token `}'
    ./hello.pl: line 2: `{\fonttbl\f0\f nil\fcharset0 AndaleMono;}'

    Any help would be great, Thanks.
  • ChaseCox
    Contributor
    • Nov 2006
    • 293

    #2
    I got it. The text editor I was using was formatting the text. I used the vi editor instead. it works. thanks.

    Comment

    Working...