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.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.