image
image

Go Back   macosx.com > Scripts > Shell/Terminal Scripts

Reply
 
LinkBack Thread Tools
  #1  
Old January 17th, 2012, 03:47 PM
Registered User
 
Join Date: Jan 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
chirp84 is on a distinguished road
.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?
Reply With Quote
  #2  
Old January 18th, 2012, 08:02 AM
ElDiabloConCaca's Avatar
U.S.D.A. Prime
 
Join Date: Aug 2001
Location: San Antonio, Texas
Posts: 14,416
Thanks: 10
Thanked 642 Times in 604 Posts
ElDiabloConCaca is a splendid one to beholdElDiabloConCaca is a splendid one to beholdElDiabloConCaca is a splendid one to beholdElDiabloConCaca is a splendid one to beholdElDiabloConCaca is a splendid one to beholdElDiabloConCaca is a splendid one to beholdElDiabloConCaca is a splendid one to behold
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
Reply With Quote
Reply

Bookmarks

Tags
.pl, os x, perl

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -5. The time now is 10:06 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Copyright 2000-2010 DigitalCrowd, Inc.