I encountered a very odd situation at work today. I was trying to debug a script (using 'perl -d /path/to/script.pl arg1 arg2 ...), and for reasons that baffle me the -d flag was apparently ignored. The script ran as if it simply wasn't there. I looked it over, looking for anything that seemed like it might conceivably trip up the debugger and was coming up with nothing. I checked earlier versions of the script, and they all entered normal debugging mode as expected.

Finally, I decided to simply start commenting out changes I'd made and keep trying until it worked. This strategy was useful, as the first line I commented out and tested turned out to be the apparent cause of the problem.

The line in question was simply a 'use' statement importing a module (part of my employer's site perl). I examined the module being imported and found nothing at all odd. I only needed a single, small subroutine from it, so I solved the problem (in the most temporary sense) by copying/pasting it into the script and calling it directly.

The module being called does work as expected regardless of the debugger strangeness. I'd love to post code here, but two things prevent me:

  1. it is the property of my employer, and I have not asked permission to post it publicly
  2. the imported module is a few hundred lines long, I think, and the script calling it is over 1800 lines; I can't imagine it would be helpful or advisable to post such voluminous code here for analysis.
Besides, as I mentioned, I've found a temporary work-around.

So my question is this. Has anyone else seen behavior like this out of the debugger? I've never heard of anything like this, and couldn't find any results that seemed relevant from google, perl.com, or here. It may not be relevant, but I believe the perl version is 5.8.8 running on Redhat/Fedora (not certain of version, but probably FC6).

Relevant links and anecdotes would be most appreciated.

Thanks,

jackofnotrades

In reply to Debugger weirdness by jackofnotrades

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.