I simply thought that this problem might be a good way for me to get my feet wet with the debugger.

Fair enough. But then - I couldn't find a question related to how to use the debugger in your post.

I thought it might bring me close to perl's machine model.

Oh, I don't think the debugger will help here. The Perl debugger may help to understand Perl code you're currently maintaining, or maybe understand the interaction with a CPAN module in cases where its documentation isn't clear enough - but it doesn't go into Perl's guts.

I know that we're encouraged to come up with an SSCCE, but this is not, nor can it easily be made so.

Then, why show the code? What do you expect us to do with it?

Question: what use statements can be removed from everything I've posted?

That question has already been answered by other monks, so let me add just a general remark: It is of little use to have use statements within a subroutine. Typically you see them near the top of the file so that it is easy to spot the dependencies of your code.

This routine has a breakpoint now:

Good - that's one of the methods to get a breakpoint into the source. Since you've already read the docs about the Perl debugger, you should be aware that you could also have done it like that:

$ perl -d 1.debug.11.pl DB<1>f debug1.pm DB<2>b 42

You could, of course, also b debug1::make_initial_captions and then step to line 42.


In reply to Re^3: Using the perl debugger to look at a renaming files function by haj
in thread Using the perl debugger to look at a renaming files function by Aldebaran

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.