By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,710 Members | 1,906 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,710 IT Pros & Developers. It's quick & easy.

New Language Simple Problem...I hope.

ChaseCox
100+
P: 294
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_Learning_Perl chase$ chmod +x hello.pl
chase:Perl_Learning_Perl chase$ ./hello.pl


and the error I received was:

./hello.pl: line 1: {rtf1ansiansicpg1252cocoartf949cocoasubrtf330: command not found
./hello.pl: line 2: syntax error near unexpected token `}'
./hello.pl: line 2: `{\fonttbl\f0\fnil\fcharset0 AndaleMono;}'

Any help would be great, Thanks.
Jun 11 '08 #1
Share this Question
Share on Google+
1 Reply


ChaseCox
100+
P: 294
I got it. The text editor I was using was formatting the text. I used the vi editor instead. it works. thanks.
Jun 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.