Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Results 1 to 2 of 2
  1. #1
    chirp84 is offline Registered User
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .pl extension on Mac OS X

    I can't run a perl program after saving it as an .rtf using TextEditor then changing file extension to .pl.

    Very frustrating. I am switching from Windows Strawberry Perl to Mac OS X Perl v5.12.3.

    The terminal feeds back:

    Backslash found where operator expected at hello.pl line 1, near "rtf1\"
    Backslash found where operator expected at hello.pl line 1, near "ansi\"
    Backslash found where operator expected at hello.pl line 1, near "ansicpg1252\"
    Backslash found where operator expected at hello.pl line 1, near "cocoartf1138\" ..... and so on

    Am I renaming the file incorrectly?

  2. #2
    ElDiabloConCaca's Avatar
    ElDiabloConCaca is offline U.S.D.A. Prime
    Join Date
    Aug 2001
    Location
    San Antonio, Texas
    Posts
    14,490
    Thanks
    10
    Thanked 648 Times in 610 Posts
    No, you're renaming the file just fine.

    The problem stems from saving the file in "Rich Text" format.

    Save the file as plaintext. The terminal will not understand a script saved as Rich Text/RTF. If you're using TextEdit that shipped with the Mac, then look in the menu for an item called "Convert to plain text". You'll know you did this right when you go to save the file and the extension is ".txt" instead of ".rtf".
    2009 Mac mini 2.0GHz • 2010 MacBook Air 11" • 2010 MacBook Pro 13" • LED 24" Cinema Display
    PowerMac G4 MDD dual 1.25GHz • PowerMac G4 Yikes! • iPad 2 32GB • 2 x iPhone 4 16GB • iPod Touch 8GB • iPod nano 1GB • iPod shuffle 1GB • AirPort Extreme dual-band • AppleTV
    http://www.jeffhoppe.com

 

 

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •