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?
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
Bookmarks