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.
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.
Comment