Marcel Grünauer > DB-Pluggable-1.112001 > DB::Pluggable::Plugin::TypeAhead

Download:
DB-Pluggable-1.112001.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.112001   Source  

NAME ^

DB::Pluggable::Plugin::TypeAhead - Debugger plugin to add type-ahead

SYNOPSIS ^

    $ cat ~/.perldb
    use DB::Pluggable;
    DB::Pluggable->run_with_config(\<<EOINI)
    [TypeAhead]
    type = {l
    type = c
    ifenv = DBTYPEAHEAD
    EOINI

DESCRIPTION ^

If you use the debugger a lot, you might find that you enter the same commands after starting the debugger. For example, suppose that you usually want to list the next window of lines before the debugger prompt - so you would enter {l - and that you usually have a breakpoint when running the debugger - so you would enter c. So you could use a plugin configuration as shown in the synopsis.

If you want to control whether this typeahead is applied, you can use the optional ifenv configuration key. If specified, its value is taken to be the name of an environment variable. When the plugin runs, the typeahead will only be applied if that environment variable has a true value.

So to continue the example from the synopsis, if you wanted to enable the typeahead, you would run your program like this:

    DBTYPEAHEAD=1 perl -d ...

The inspiration for this plugin came from Ovid's blog post at http://blogs.perl.org/users/ovid/2010/02/easier-test-debugging.html.

METHODS ^

afterinit

Pushes the commands to the debugger's typeahead.

syntax highlighting: