I'm going to cry. I'm having the most unusual, frustrating problem, and to make matters worse it's a platform-specific problem (I think). But it's one of those things that is so simple as to be simply impossible. Help?

I'll sum up by saying that I have code where join seems to be just plain not working, broken.

I have a little bit of code that looks like this:

print @lines; # prints array, no prob. print join("", @lines); # prints array, but not on win32.
The problem is that only the first print statement causes anything to be printed. The first print statement causes @lines to be printed, but the second one doesn't. In other words, the first construction works, but using join seems to just eat the array. BUT only on win32 - on linux it works fine. I even thought maybe it was just a 5.6.0 bug, so I updated to activestate's 5.6.1 - same prob.

Even more frustrating is that I can't cause this reliably - I tried to tear it down into a simple test case...but the test case doesn't exibit the bug. I'm going insane. But I swear that damned join is NOT working and I can't imagine why. :-(

I would feel better if I could make a test case fail, but I can't and I can't imagine any difference between the simplest test case and my actual code. I mean the first line works and the second one doesn't - how can it be simpler?


In reply to I think I'm going insane. Join doesn't work? by chewtoy

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.