New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

OS 10.5 - Can't properly save and use script (Perl) files

Post Reply New Thread Subscribe

Thread Tools

Member Since: May 09, 2008
Posts: 5
mscoxoh is on a distinguished road

mscoxoh is offline
I can't get Perl scripts in my path to properly run under Mac OS X (10.5.2). I'm using Smultron to edit the files, and have also taken them into nano via Terminal and saved both as DOS and Mac formats. When I save as DOS, I get this when I run the file:

/usr/bin/perl^M: bad interpreter: No such file or directory

I assume it's having problem interpreting the DOS CR/LF character and shows "^M" as a result. When I save in "Mac" format, the script does nothing (not even an error) when I run it. If I cat the Mac formatted script, it doesn't display properly:

$ cat
$ FG,SWITCHCFG); shutports/ig) {(.+)/ig) {

(You're seeing a tiny portion of the script there; not even the end of it - but that's all it shows.) If I save in the DOS format, I can workaround the problem by running it as "perl path/"; this eliminates the misinterpretation of !#user/bin/perl^M above. What am I doing wrong? Can I not run perl scripts that are in my path without typing the longhand "perl pathlist/filename"? Thanks.
QUOTE Thanks

Post Reply New Thread Subscribe

« Help! Privacy Issue | Items that can be deleted to create space i.e.Printer Drivers?? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
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 On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 11:09 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?