I seek the wisdom of the monks: In order to diagnose some problems in caller scripts, I included the guts of Devel::Caller::Perl at the bottom of my script so I can see the arguments subs were called with in the error logs.
#!/usr/bin/perl use strict; use warnings; print 1; #insert __END__ here and debugger works fine use DB; sub import { *{(caller)[0].'::called_args'} = \&called_args if $_[1] eq 'called_args'; } sub called_args { &DB::called_args } package DB; sub called_args { my ($level) = @_; my @foo = caller( ( $level || 0 ) + 3 ); wantarray ? @DB::args : \@DB::args; }
Including this code causes the script to run to completion and exit when called with  perl -d myscript.pl Works fine when removed. I'm guessing messing with the definition of the DB package is overwriting something I shouldn't be. I was hoping the monks could shed some light as to what's going on and how to work around it or do it correctly. Thanks!

In reply to Debugger doesn't interrupt by qleem

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.