Two questions:
  1. 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.
  2. 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.
  3. 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.


In reply to RE: Re: Hidden Characters? by Fastolfe
in thread Hidden Characters? by tame1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.