Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to test my perl install

Status
Not open for further replies.

matthewst

IS-IT--Management
May 1, 2007
25
0
0
US
XServe with perl5.8.6
I can run perl -v and it tells me I have perl5.8.6.

In terminal I type perl test1.pl
test1.pl:
Code:
#!/usr/bin/perl
print "Hello World.";

I then get this output:
Code:
perl test1.pl
Backslash found where operator expected at test1.pl line 1, near "rtf1\"
Backslash found where operator expected at test1.pl line 1, near "mac\"
Backslash found where operator expected at test1.pl line 1, near "ansicpg10000\"
Backslash found where operator expected at test1.pl line 1, near "cocoartf824\"
Backslash found where operator expected at test1.pl line 2, near "fonttbl\"
Backslash found where operator expected at test1.pl line 2, near "f0\"
Backslash found where operator expected at test1.pl line 2, near "fswiss\"
Backslash found where operator expected at test1.pl line 3, near "red255\"
Backslash found where operator expected at test1.pl line 3, near "green255\"
Backslash found where operator expected at test1.pl line 4, near "margl1440\"
Backslash found where operator expected at test1.pl line 4, near "margr1440\"
Backslash found where operator expected at test1.pl line 4, near "vieww9000\"
Backslash found where operator expected at test1.pl line 4, near "viewh8400\"
Backslash found where operator expected at test1.pl line 5, near "viewkind0
\"
        (Missing semicolon on previous line?)
Backslash found where operator expected at test1.pl line 5, near "pard\"
Backslash found where operator expected at test1.pl line 5, near "tx720\"
Backslash found where operator expected at test1.pl line 5, near "tx1440\"
Backslash found where operator expected at test1.pl line 5, near "tx2160\"
Backslash found where operator expected at test1.pl line 5, near "tx2880\"
Backslash found where operator expected at test1.pl line 5, near "tx3600\"
Backslash found where operator expected at test1.pl line 5, near "tx4320\"
Backslash found where operator expected at test1.pl line 5, near "tx5040\"
Backslash found where operator expected at test1.pl line 5, near "tx5760\"
Backslash found where operator expected at test1.pl line 5, near "tx6480\"
Backslash found where operator expected at test1.pl line 5, near "tx7200\"
Backslash found where operator expected at test1.pl line 5, near "tx7920\"
Backslash found where operator expected at test1.pl line 5, near "tx8640\"
Backslash found where operator expected at test1.pl line 5, near "ql\"
Backslash found where operator expected at test1.pl line 5, near "qnatural\"
Backslash found where operator expected at test1.pl line 7, near "pardirnatural

\"
        (Missing semicolon on previous line?)
Backslash found where operator expected at test1.pl line 7, near "f0\"
Backslash found where operator expected at test1.pl line 7, near "fs24 \"
        (Do you need to predeclare fs24?)
Backslash found where operator expected at test1.pl line 8, near "cf0 #!/usr/bin/perl\
\"
        (Missing semicolon on previous line?)
Backslash found where operator expected at test1.pl line 8, near "pard\"
Backslash found where operator expected at test1.pl line 8, near "tx560\"
Backslash found where operator expected at test1.pl line 8, near "tx1120\"
Backslash found where operator expected at test1.pl line 8, near "tx1680\"
Backslash found where operator expected at test1.pl line 8, near "tx2240\"
Backslash found where operator expected at test1.pl line 8, near "tx2800\"
Backslash found where operator expected at test1.pl line 8, near "tx3360\"
Backslash found where operator expected at test1.pl line 8, near "tx3920\"
Backslash found where operator expected at test1.pl line 8, near "tx4480\"
Backslash found where operator expected at test1.pl line 8, near "tx5040\"
Backslash found where operator expected at test1.pl line 8, near "tx5600\"
Backslash found where operator expected at test1.pl line 8, near "tx6160\"
Backslash found where operator expected at test1.pl line 8, near "tx6720\"
Backslash found where operator expected at test1.pl line 8, near "ql\"
Backslash found where operator expected at test1.pl line 8, near "qnatural\"
Backslash found where operator expected at test1.pl line 9, near "pardirnatural
\"
        (Missing semicolon on previous line?)
syntax error at test1.pl line 1, near "rtf1\"
syntax error at test1.pl line 3, near "red255\"
syntax error at test1.pl line 4, near "margl1440\"
Execution of test1.pl aborted due to compilation errors.
 
try:
which perl
to verify your #! line
and try:
perl test1.pl


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions;
 
which perl returns:
/usr/bin/perl

perl test1.pl returns:
the same error i've been getting
 
What did you use to write your script? Perl is complaining about errors on line 9 even though you've only 2 lines in your script. Sounds to me as if you may have saved it as some other format than plain text.
 
ooh.. and the first line of the script says rtf .. maybe Rich Text Format?? Good call.. I just assumed it was something else.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions;
 
....I'm a jackass.....

So how exactly do I write a perl script? Dreameaver maybe?
 
you guys rock!!!!
I opened it with golive

Code:
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\fs24 \cf0 #!/usr/bin/perl\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\cf0 print "Hello World.";}[code]

Thanks!!!
 
If you're just testing, and using a Windows OS, just start with notepad and save as plain text. There are loads of editors out there that support various Perl-friendly features for later on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top