You might start testing your hypothesis (see
moritz reply, above) by double-checking your line 13. One obvious test (and this deal with the issue raised by
SteveS832001) would be to try a different directory to write to.
However, it just so happens that I'm not at all sure that's the problem.
Works for me (update:) if allowed to run for approx 15+ iterations (precise count not determined. The shock was too great... and this oddity was discovered only when I found that at significantly higher counts, the content of OUTPUT.TXT is NOT in the order which I had expected from your code, nor from the display to the terminal.)
update2
Hunh??? /methinks there may be some buffering issues, as my output file is NOT ALWAYS misordered, but if not, tends to have lost some of the output seen on screen.)
FTR, the adjustments I made to OP's script were limited to changing the quotes to singles (and later, redirecting output to another drive) and testing on localhost (127.0.0.1) where I have (intranet) Apache running.
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.