Here is a larger code example - the array @testDateRows has the series of dates that I will be testing - in this case close to a thousand days.
The array @algTickers has all of the names of the data files that will be looked at - several thousand are in there.

When I set it to close after it runs once (tmpCounter > 0), then it works great that one time. It will output all the tickers quickly and it doesn't complain.
When I set the tmpCounter to 1, as it is below, meaning that it runs through the outer loop twice, then I see issues in there for every single spot.
I get the error "Use of uninitialized value in concatenation (.) or string at" some line number in the thing. (it refers to the line number where the open is trying to take place)

This would make me think that since the names are derived from pulling out the filenames of a directory, then the "." and ".." snuck into the array. But I have accounted for their removal in the code that populates that array, and I have output that array to a file to look at the data and it is all correct.

What is wrong with the code below that would allow it to work perfectly one time through the loop, and then the next time through the loop (and every time after that) fail?
I also haven't figured out why at some point it will also clear the screen out - at this level of iteration it doesn't do it, but it will if I get rid of the if statement that will exit.
my $tmpCounter = 0; for(@testDateRows){ if($tmpCounter > 1){ exit; } @tmpArr = split(',',$_); $formattedName = $tmpArr[0]; #iterate through all the tickers for(@algTickers){ $strTickerName = $_; #there is an open call in here that works, I commented it out to see i +f I could still reproduce the problem # open... print "$strTName:$formattedName\n"; #now we need to load the a file $strAlg = ''; open(ALGFILE,"/A/sub/$strTName") or die "can't open th +e asub file: $strTName : $!\n"; while(<ALGFILE>){ $strAlg .= $_; } close(ALGFILE) or die "can't close the asub file: $str +TName :$!\n"; } $tmpCounter++; }


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

In reply to Re: Strange crash - any ideas? by AssFace
in thread 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.