I am seeing an odd behavior here, which is making me assume at this point that something I thought I was doing properly is actually incorrect.

I have a directory A, in that directory are thousands of files that are in the name style of all caps letters. AAA, ABC, TTH, RTYU, etc (stock tickers).

I have a directory within that A directory that has files that are named exactly like the files in the directory above. But there is different information in there.
That data looks like:
H: 1.000000 B: 2,0,-1.57
My code is starting off and getting all of the filenames out of the subdir and populating an array. I have checked that visually and each spot is correct and there are no blank spots in there.

I iterate over that array and I open the file that matches that in the A directory. I put that into an array, and I then splice off parts of it, and then reverse that array.
All of that works perfectly over and over and over again for thousands of iterations.

But the instant I uncomment this code here that follows that code, it does something I've never seen before.
$strASub = ''; open(ASUBFILE,"/A/sub/$strTName") or die "can't open the asub file: $s +trTName : $!\n"; while(<ASUBFILE>){ $strASub .= $_; } close(ASUBFILE) or die "can't close the asub file: $strTName :$!\n";
Once that code is uncommented, then it fails. It will dump out something that clears my ssh screen and then a bunch of space, and then some other tickernames will show up separated by odd characters like superscript 1s and other things like that.

If I comment the code, then everything works out well - uncommented, crash. I can't trace down what file it doing it because it dies and clears the screen. I tried debugging it locally on my laptop, but I have some issues with this laptop where it will overheat and die easily.

Is that open call incorrect? Is there an easy way I could check over 1000 files to see if one has odd data in it that is causing this to break?
It looks like a similar issue to a buffer overflow.


-------------------------------------------------------------------
There are some odd things afoot now, in the Villa Straylight.

In reply to Strange crash - any ideas? by AssFace

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.