<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: bad interpreter: No such file or directory</title>
	<atom:link href="http://www.elharo.com/blog/software-development/perl/2007/01/11/bad-interpreter-no-such-file-or-directory/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elharo.com/blog/software-development/perl/2007/01/11/bad-interpreter-no-such-file-or-directory/</link>
	<description>Ranting and Raving</description>
	<lastBuildDate>Thu, 09 Feb 2012 17:01:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: imanijit</title>
		<link>http://www.elharo.com/blog/software-development/perl/2007/01/11/bad-interpreter-no-such-file-or-directory/comment-page-1/#comment-900716</link>
		<dc:creator>imanijit</dc:creator>
		<pubDate>Fri, 12 Nov 2010 23:17:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/mac/2007/01/11/bad-interpreter-no-such-file-or-directory/#comment-900716</guid>
		<description>Also, if you are moving your file from a Mac to a Linux machine, be aware that:
#!/usr/bin/Perl 
and
#!/usr/bin/perl

do not mean the same thing to a case-sensitive file system like Linux.
Not gonna admit to how long it took me to figure  out why my script worked fine on my Mac and failed on my Linux box. &gt;.&lt;</description>
		<content:encoded><![CDATA[<p>Also, if you are moving your file from a Mac to a Linux machine, be aware that:<br />
#!/usr/bin/Perl<br />
and<br />
#!/usr/bin/perl</p>
<p>do not mean the same thing to a case-sensitive file system like Linux.<br />
Not gonna admit to how long it took me to figure  out why my script worked fine on my Mac and failed on my Linux box. &gt;.&lt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guest</title>
		<link>http://www.elharo.com/blog/software-development/perl/2007/01/11/bad-interpreter-no-such-file-or-directory/comment-page-1/#comment-874346</link>
		<dc:creator>guest</dc:creator>
		<pubDate>Mon, 21 Jun 2010 13:39:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/mac/2007/01/11/bad-interpreter-no-such-file-or-directory/#comment-874346</guid>
		<description>./test.pl
: No such file or directory


The Problem could also be: The script has been written with windows-line-endings. So Linux can&#039;t parse it...</description>
		<content:encoded><![CDATA[<p>./test.pl<br />
: No such file or directory</p>
<p>The Problem could also be: The script has been written with windows-line-endings. So Linux can&#8217;t parse it&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.elharo.com/blog/software-development/perl/2007/01/11/bad-interpreter-no-such-file-or-directory/comment-page-1/#comment-865987</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 23 Feb 2010 04:37:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/mac/2007/01/11/bad-interpreter-no-such-file-or-directory/#comment-865987</guid>
		<description>Maybe you can help me I&#039;m trying to write a simple input -&gt; logfile script and keep getting the message &quot;cannot create link to logfile: No such file or directory at /private/var/folders/EZ/EZjgQkjmGqen0F4rMB61CU+++TI/Cleanup At Startup/filehandletest-288592573.001.pl line 8,  line 2.&quot;

but I can&#039;t figure out what&#039;s going wrong!

my code is as follows:
#!/usr/bin/perl
use 5.010;
use strict;
print &quot;Enter some text then hit control+D and we\&#039;ll try to send it to the perlogfile:\n&quot;;
my @stuff = ;
open LOG, &quot;&gt;&gt;&quot;, &quot;/Users/rk/Documents/perlogfile.rtf&quot;; # im getting permission denied here when trying to write to or create this file, wtf?
if (! open LOG ) {
die &quot;cannot create link to logfile: $!&quot;;
}
print LOG &quot;@stuff&quot;;
close (LOG);</description>
		<content:encoded><![CDATA[<p>Maybe you can help me I&#8217;m trying to write a simple input -&gt; logfile script and keep getting the message &#8220;cannot create link to logfile: No such file or directory at /private/var/folders/EZ/EZjgQkjmGqen0F4rMB61CU+++TI/Cleanup At Startup/filehandletest-288592573.001.pl line 8,  line 2.&#8221;</p>
<p>but I can&#8217;t figure out what&#8217;s going wrong!</p>
<p>my code is as follows:<br />
#!/usr/bin/perl<br />
use 5.010;<br />
use strict;<br />
print &#8220;Enter some text then hit control+D and we\&#8217;ll try to send it to the perlogfile:\n&#8221;;<br />
my @stuff = ;<br />
open LOG, &#8220;&gt;&gt;&#8221;, &#8220;/Users/rk/Documents/perlogfile.rtf&#8221;; # im getting permission denied here when trying to write to or create this file, wtf?<br />
if (! open LOG ) {<br />
die &#8220;cannot create link to logfile: $!&#8221;;<br />
}<br />
print LOG &#8220;@stuff&#8221;;<br />
close (LOG);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ram</title>
		<link>http://www.elharo.com/blog/software-development/perl/2007/01/11/bad-interpreter-no-such-file-or-directory/comment-page-1/#comment-567719</link>
		<dc:creator>Ram</dc:creator>
		<pubDate>Thu, 30 Oct 2008 15:44:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/mac/2007/01/11/bad-interpreter-no-such-file-or-directory/#comment-567719</guid>
		<description>I was trying to run a script that I copied off the web and pasted into Notepad and saved to my Linux dev server.  It had two problems - one, the shebang line referenced /usr/local/bin instead of /usr/bin/perl and two, the interpreter didn&#039;t like my Windows linefeeds.  I deleted the script and used vim to create the .pl file, corrected the shebang line and everything worked. Thank you for this very useful post that pinpointed both issues.</description>
		<content:encoded><![CDATA[<p>I was trying to run a script that I copied off the web and pasted into Notepad and saved to my Linux dev server.  It had two problems &#8211; one, the shebang line referenced /usr/local/bin instead of /usr/bin/perl and two, the interpreter didn&#8217;t like my Windows linefeeds.  I deleted the script and used vim to create the .pl file, corrected the shebang line and everything worked. Thank you for this very useful post that pinpointed both issues.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim_Myth</title>
		<link>http://www.elharo.com/blog/software-development/perl/2007/01/11/bad-interpreter-no-such-file-or-directory/comment-page-1/#comment-503977</link>
		<dc:creator>Tim_Myth</dc:creator>
		<pubDate>Mon, 25 Aug 2008 13:14:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/mac/2007/01/11/bad-interpreter-no-such-file-or-directory/#comment-503977</guid>
		<description>YOU ARE AWESOME!!!  My webhost moved my site to a new server, and suddenly one of my cgi scripts quit working. I had the hosting company rebuild my site from a last known good back up, but still got the same problem. I poured over the code line by line, tried to figure out which directory was bad, and ripped a few hairs out (and there&#039;s not many of those to spare!). I even lowered myself to asking one of my buddies for help. He&#039;s a PhD candidate and the sacrifice was great, but I could not find my error. Even he could find no reason for the error (although he found much fault in my coding skills). I finally stumbled acrossed this post, and (not believing it could be that simple) had my site fixed in a matter of seconds.</description>
		<content:encoded><![CDATA[<p>YOU ARE AWESOME!!!  My webhost moved my site to a new server, and suddenly one of my cgi scripts quit working. I had the hosting company rebuild my site from a last known good back up, but still got the same problem. I poured over the code line by line, tried to figure out which directory was bad, and ripped a few hairs out (and there&#8217;s not many of those to spare!). I even lowered myself to asking one of my buddies for help. He&#8217;s a PhD candidate and the sacrifice was great, but I could not find my error. Even he could find no reason for the error (although he found much fault in my coding skills). I finally stumbled acrossed this post, and (not believing it could be that simple) had my site fixed in a matter of seconds.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rajput</title>
		<link>http://www.elharo.com/blog/software-development/perl/2007/01/11/bad-interpreter-no-such-file-or-directory/comment-page-1/#comment-330854</link>
		<dc:creator>rajput</dc:creator>
		<pubDate>Wed, 02 Apr 2008 07:22:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/mac/2007/01/11/bad-interpreter-no-such-file-or-directory/#comment-330854</guid>
		<description>Thanks for the information for “bad interpreter: No such file or directory” error. I too got the same error. But i solved it in a different way. I had written a script in Windows and was trying to execute it on a device with linux kernel. What is did is changed my Windows scripts file to a UNIX format. And Yes!!! The error was gone :-)</description>
		<content:encoded><![CDATA[<p>Thanks for the information for “bad interpreter: No such file or directory” error. I too got the same error. But i solved it in a different way. I had written a script in Windows and was trying to execute it on a device with linux kernel. What is did is changed my Windows scripts file to a UNIX format. And Yes!!! The error was gone :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rog</title>
		<link>http://www.elharo.com/blog/software-development/perl/2007/01/11/bad-interpreter-no-such-file-or-directory/comment-page-1/#comment-251873</link>
		<dc:creator>Rog</dc:creator>
		<pubDate>Tue, 05 Feb 2008 14:27:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/mac/2007/01/11/bad-interpreter-no-such-file-or-directory/#comment-251873</guid>
		<description>Thanks, I&#039;ve never seen the construct Neville showed, it worked</description>
		<content:encoded><![CDATA[<p>Thanks, I&#8217;ve never seen the construct Neville showed, it worked</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: memememe</title>
		<link>http://www.elharo.com/blog/software-development/perl/2007/01/11/bad-interpreter-no-such-file-or-directory/comment-page-1/#comment-38681</link>
		<dc:creator>memememe</dc:creator>
		<pubDate>Tue, 30 Jan 2007 21:31:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/mac/2007/01/11/bad-interpreter-no-such-file-or-directory/#comment-38681</guid>
		<description>Thank you so much for posting this!  I spent all morning trying to figure out if there was something wrong with my Perl install (I&#039;m on a 10.3.9 machine).. I even checked the ADC website for notes about Perl and couldn&#039;t find anything!!  perl -e was working but reading from my file wasn&#039;t.  Finally I searched on the &quot;bad interpreter&quot; error and found your page.  I switched to &quot;Unix&quot; in BBEdit and it fixed it.  Thank you so so much!</description>
		<content:encoded><![CDATA[<p>Thank you so much for posting this!  I spent all morning trying to figure out if there was something wrong with my Perl install (I&#8217;m on a 10.3.9 machine).. I even checked the ADC website for notes about Perl and couldn&#8217;t find anything!!  perl -e was working but reading from my file wasn&#8217;t.  Finally I searched on the &#8220;bad interpreter&#8221; error and found your page.  I switched to &#8220;Unix&#8221; in BBEdit and it fixed it.  Thank you so so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neville Rowe</title>
		<link>http://www.elharo.com/blog/software-development/perl/2007/01/11/bad-interpreter-no-such-file-or-directory/comment-page-1/#comment-33878</link>
		<dc:creator>Neville Rowe</dc:creator>
		<pubDate>Mon, 15 Jan 2007 13:01:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.elharo.com/blog/mac/2007/01/11/bad-interpreter-no-such-file-or-directory/#comment-33878</guid>
		<description>Perl used to recommend not doing #!/usr/bin/perl to get the interpreter. Instead you did

#!/bin/sh
exec perl -w -x $0
#!perl

or some other such construct - sorry, it&#039;s too long since I&#039;ve done this regularly.

This has the advantage that sh searches the path for Perl, rather than the location being coded in the script. -w is a special flag which tells Perl to scan for a #!perl line in the file and start executing from there. I appear to remember there is a slight downside that linenumbers when debugging are out slightly ?</description>
		<content:encoded><![CDATA[<p>Perl used to recommend not doing #!/usr/bin/perl to get the interpreter. Instead you did</p>
<p>#!/bin/sh<br />
exec perl -w -x $0<br />
#!perl</p>
<p>or some other such construct &#8211; sorry, it&#8217;s too long since I&#8217;ve done this regularly.</p>
<p>This has the advantage that sh searches the path for Perl, rather than the location being coded in the script. -w is a special flag which tells Perl to scan for a #!perl line in the file and start executing from there. I appear to remember there is a slight downside that linenumbers when debugging are out slightly ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

