wwplyr has asked for the wisdom of the Perl Monks concerning the following question:
I am just beginning to learn Perl so I can handle the forms on my website. The very first thing is to do the "Hello,World" code. I typed and saved the code as a ".pl" file. But when I try to get it to run, I get this long string of mistakes. I am using an iMac OS 10.6.8, which is running perl, v5.10.0 built for darwin-thread-multi-2level. Here's my code:
#!/usr/bin/perl
use strict;
use warning;
print "Hello, World!\n";
Here's my error list:
Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 1, near "rtf1\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 1, near "ansi\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 1, near "ansicpg1252\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 1, near "cocoartf1038\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 2, near "fonttbl\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 2, near "f0\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 2, near "fswiss\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 3, near "red255\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 3, near "green255\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 4, near "margl1440\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 4, near "margr1440\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 4, near "vieww9000\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 4, near "viewh8400\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "viewkind0 \" (Missing semicolon on previous line?) Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "pard\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx720\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx1440\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx2160\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx2880\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx3600\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx4320\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx5040\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx5760\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx6480\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx7200\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx7920\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "tx8640\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "ql\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 5, near "qnatural\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 7, near "pardirnatural \" (Missing semicolon on previous line?) Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 7, near "f0\" Backslash found where operator expected at /Users/patnonadmin/Desktop/hello#1.pl line 7, near "fs24 \" (Do you need to predeclare fs24?) syntax error at /Users/patnonadmin/Desktop/hello#1.pl line 1, near "rtf1\" syntax error at /Users/patnonadmin/Desktop/hello#1.pl line 3, near "red255\" syntax error at /Users/patnonadmin/Desktop/hello#1.pl line 4, near "margl1440\" "use" not allowed in expression at /Users/patnonadmin/Desktop/hello#1.pl line 8, at end of line "use" not allowed in expression at /Users/patnonadmin/Desktop/hello#1.pl line 9, at end of line syntax error at /Users/patnonadmin/Desktop/hello#1.pl line 11, near ";}" Execution of /Users/patnonadmin/Desktop/hello#1.pl aborted due to compilation errors.
Why is there such a long list? I'm assuming that the Terminal is running "macperl" but it doesn't say so.
How do I get past this mess?
Thanks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Beginning Problems
by aitap (Curate) on Jan 24, 2013 at 20:15 UTC | |
Re: Beginning Problems
by mhearse (Chaplain) on Jan 24, 2013 at 20:27 UTC | |
by Jenda (Abbot) on Jan 25, 2013 at 11:53 UTC | |
by mhearse (Chaplain) on Jan 27, 2013 at 23:40 UTC | |
by mhearse (Chaplain) on Feb 04, 2013 at 17:02 UTC | |
by Anonymous Monk on Jan 25, 2013 at 15:13 UTC | |
by Jenda (Abbot) on Jan 25, 2013 at 23:28 UTC | |
by choroba (Cardinal) on Jan 25, 2013 at 23:34 UTC | |
by Anonymous Monk on Jan 26, 2013 at 09:56 UTC | |
by Anonymous Monk on Jan 26, 2013 at 07:33 UTC | |
Re: Beginning Problems
by Kenosis (Priest) on Jan 24, 2013 at 20:16 UTC | |
Re: Beginning Problems
by blue_cowdawg (Monsignor) on Jan 24, 2013 at 21:16 UTC | |
Re: Beginning Problems
by rnaeye (Friar) on Jan 25, 2013 at 03:58 UTC |