I won't even try to find errors in your script with such scant information, but I think I can still help you help yourself.

Perl has a built-in debugger and that is just what you need now. You can find the details with 'perldoc perldebug'.

The important thing, with the debugger you can single-step through the exact moment your bug happens and look at all the variables.

To get to where the interesting things happen you need to set a breakpoint. For example if you know that your script always breaks after 34050 lines, add a breakpoint inside the loop with 'b <linenumber> ++$countxy > 34048' and just let it run with the 'c' command

2 loop executions before your hot spot the script will stops at your breakpoint and you can inspect any variable with 'p <varname>' or nested data structure with 'x'. Then execute further step by step with 's' and watch what happens with 'p' or 'x' (also 'n' and 'r' help step over uninteresting parts).

If you don't know the loop count but a condition that is true when your bad stuff happens, use that for a breakpoint. You also can use 'a' to make any checks while the program runs to first find out at what loop iteration the bad stuff happens, then restart and set a breakpoint shortly before that point


In reply to Re: input data got lost in foreach loop?! by jethro
in thread input data got lost in foreach loop?! by FluffyBunny

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.