48 users online (1 members and 47 guests)  


  Results 1 to 2 of 2

Related

  1. Error: Expected ;    Forum: PHP Forum
    Replies: 0
  2. Song not Found!    Forum: Myspace Forum
    Replies: 5
  3. found this one GREAT    Forum: Web Hosting Forum
    Replies: 0
  1. #1
    matthewst's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2007
    Posts
    4

    Backslash found where operator expected at test1.pl

    In terminal (on XServe) I can run "perl -v" and "which perl". When I run "perl test1.pl" I get an error.

    test1.pl:
    Code:
    #!/usr/bin/perl
    print "Hello World.";
    error:
    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.

  2. #2
    matthewst's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2007
    Posts
    4

    Re: Backslash found where operator expected at test1.pl

    I had previously saved it in rtf format. So perl was seeing this:
    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.";}