Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Can't run Perl scripts in Leopard
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="mscoxoh" data-source="post: 652161" data-attributes="member: 55483"><p>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:</p><p></p><p>/usr/bin/perl^M: bad interpreter: No such file or directory</p><p></p><p>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:</p><p></p><p>$ cat perlscript.pl </p><p>$ FG,SWITCHCFG); shutports/ig) {(.+)/ig) {</p><p></p><p>(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/scriptname.pl"; 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.</p></blockquote><p></p>
[QUOTE="mscoxoh, post: 652161, member: 55483"] 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 perlscript.pl $ 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/scriptname.pl"; 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]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Can't run Perl scripts in Leopard
Top