Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
You should be able to define the subs you mention in .perldb (either in the current directory, or in ~/.perldb on Unix-like systems). Quoting the debugger's internal docs (perldoc
When starts, it reads an rcfile (perl5db.ini for non-interactive sessions, .perldb for interactive ones) that can set a number of options. In addition, this file may define a subroutine afterinit that will be executed (in the debugger's context) after the debugger has initialized itself. This can be set in the options, or by setting it in .perldb.
afterinit() runs a little too late - after TTY allocation - so you can't do the TTY mojo there. However, .perldb gets control right after option processing, and just before the get_fork_TTY subroutine is checked for and called, so it's an optimum point to set this up if you don't want to use another module to do it.

You can of course use a module that defines DB::get_fork_TTY in .perldb as well, if you prefer to have all your magic in one place, so to speak.

Another item of note is the $DB::CreateTTY variable, which controls when the debugger decides to try grabbing a new TTY (this is a bit-field scalar, so if you want more than one option, you sum them):

  • 1 - on fork()
  • 2 - when debugger is started inside the debugger
  • 4 - on startup
This lets you decide when you want (and when you don't want) the debugger to try grabbing another TTY. The default is 3 (on fork, and on nest).

In reply to Re: Debugging Perl scripts which use fork() by pemungkah
in thread Debugging Perl scripts which use fork() by IlyaM

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (6)
    As of 2020-02-21 13:47 GMT
    Find Nodes?
      Voting Booth?
      What numbers are you going to focus on primarily in 2020?

      Results (96 votes). Check out past polls.