0) That makes a big difference, and is one possibility I suspected all along. Can you verify that the script you posted replicates the errant behavior? Because for me it doesn't. Since you're not showing us the actual code, it is encumbant on you to provide code that replicates the problem
without introducing other bugs (ie, wild goose chases).
1) Fine, but again we didn't know that. The fact is that your double-use of the same file isn't causing a problem in this case, it's just asking for trouble if you use it in production though. And we had no way of knowing that your test code introduced elements not present in your production code.
2) Are both machines the same OS? If not, did you make sure to convert your line endings? I'm still keeping that one open as an option.
3) I ran your script using a text file instead of an empty file. I also ran it with an empty file as you're doing. It worked fine both ways. So again I have to ask if this snippet you've provided replicates the errant behavior.
As I said before, if you're dealing with different operating systems, ensure that you have converted your line endings.
And jeffa may also be right, with the suggestion to ensure that on both of your machines, your script has permission to work with the file in question.
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.