Two questions:
- Does the output of 'which perl' (on the command-line) differ from the first line of your Perl script (in other words, are you calling two different versions of the same Perl executable)? Perhaps it's the Perl binary itself that's giving you this error message.
- Try viewing your script with 'vi' or 'view', which typically gives you a better view of any embedded control characters (such as an evil trailing DOS newline). A standard pager (like less or more) typically ignores trailing ^M's. Emacs may also.
- Do you have 'lsof' on your system? Is there any way you can identify any other applications that might have this script open? Perhaps Emacs is somehow continuing to hold a lock?
The open syscall can fail with this message (ETXTBSY), but usually only if the requested file is being executed (which may not be the case or make sense in this instance, since Perl scripts aren't so much executed as they are read by the Perl interpreter) when an open request comes in with O_WRONLY or O_RDWR flags. This doesn't really make a lot of sense.
What operating system are you using? I'd like to dig further on the cases where you'd get this message. I'd also kinda like to see the first line of your script, the location of your Perl binary, and the permissions of your script. | [reply] |
Let's see....ok. The "regular" perl binary is /usr/bin/perl (which is
itself a link to /usr/bin/perl-5.00503
My shebang is #!/usr/local/bin/perl -w which is a symlink to /usr/bin/perl
So yes, there are two levels of syms involved.
However, I think one of the earlier guys had it - my emacs is
saving in DOS mode. Why, I have no idea. How to stop it, I also
don't know. Does anyone?
What does this little button do . .<Click>;
"USER HAS SIGNED OFF FOR THE DAY"
| [reply] |
I disagree. If emacs were saving in DOS mode (which means the newlines are comprised of a ^M^J (\r\n) instead of the Unix ^J (\n)), copying the file with 'cp' should have no effect whatsoever. 'cp' does not do any conversions, so it makes 0 sense that the problem would clear up simply by coping the file to a new name. This is why I think it's a filesystem/OS issue.
| [reply] |