Are you referring to the FTP "problem" where Win or Mac to Linux files throw in an extra char for newlines? In that case, ALL newlines are affected, not just the first line. I'm not sure whether Perl likes funky chars like ^M in it's parsing engine, so a sort of converter would be in order. All it needs to do is convert the DOS newline to the '\n' (that's the C character \n and not the Perl \n for your info, but under Linux the C code is \n anyway...) I'm sure there is already one readily available somewhere on this site....hmmm...
The second problem (seemingly unrelated) deals with a text file busy response. That's not a perl error response (at least not in <5.6 since I just looked it up in an old book) and probably has something to do with a mandatory lock failure on open(). I can't imagine that perl tries to lock the file (does it, though?), so you are probably using a linux kernel with mandatory locking compiled in...is that right? Anyway, I don't think emacs is locking the file (it does not, by default, unless...well, not by default). What made you cp it somewhere else and back. If this were mandatory locking, cp would fail on the open read just as perl would. No- something is fishy in your story. (p.s. emacs will not IN ANY FASHION insert a hidden character as you propose unless you save it in some strange manner (DOS mode?) and these two problems that you are having are unrelated!)
AgentM Systems nor Nasca Enterprises nor
Bone::Easy nor Macperl is responsible for the
comments made by
AgentM. Remember, you can build any logical system with NOR.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|