can anyone recommend a debugging tip?

Have you tried using the perl debugger?

If you have identified the particular open statement that causes the failure, and you can work out the line number of that statement, run the script with a command line like this:

perl -d name_of_script [...]
Where the square brackets around "..." mean "this is where you would put command-line args for the script, if it takes args, otherwise, don't put anything here".

That runs the script via the perl debugger, which starts by giving you a prompt for what to do next. At this point, it's handy to have the source code on display in a separate window (e.g. in an editor).

The first thing to do is "b NNN" (where NNN is the line number of the open statement in question). This sets a breakpoint at that line, so that the debugger will stop execution and prompt you for more things to do just before it executes the chosen line. After setting the breakpoint, enter "c" to "continue" execution of the script, and wait for it to reach the breakpoint.

Once execution stops, use the "p" command to inspect the values of relevant variables, to confirm that they contain what you expect. Read the "perldebug" man page, and try the "h" command in the debugger for more pointers on what you can do.


In reply to Re: open fails with no error code by graff
in thread open fails with no error code by Anonymous Monk

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.