| 1 | package Data::Tersify::perldb; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use Data::Tersify; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | Data::Tersify::perldb - override the standard perl debugger's behaviour | ||
| 11 | |||
| 12 | =head1 SYNOPSIS | ||
| 13 | |||
| 14 | # In your .perldb file | ||
| 15 | use Data::Tersify::perldb; | ||
| 16 | |||
| 17 | # The x command now automatically passes data through | ||
| 18 | # Data::Tersify::tersify | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | This is a very simple convenience module that implements a DB::afterinit | ||
| 23 | method that patches the x command so it effectively means | ||
| 24 | C<x Data::Tersify::tersify(...)> instead. Import it from your .perldb | ||
| 25 | file to have the output of x tersified automatically. | ||
| 26 | |||
| 27 | If you already have a DB::afterinit method, or would prefer other things | ||
| 28 | to be tersified, just cut and paste the appropriate code. | ||
| 29 | |||
| 30 | Many thanks to Ovid, whose | ||
| 31 | L<.perldb file|https://gist.github.com/Ovid/919234335d7fc27fca3ec63e6f3782ce> | ||
| 32 | was an inspiration and a useful guide. | ||
| 33 | |||
| 34 | =cut | ||
| 35 | |||
| 36 | 0 | ▶ | sub DB::afterinit { |
|
Subroutine
afterinit: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 37 | 0 | $DB::alias{x} = 's/^ x \s (.+) /x Data::Tersify::tersify_many($1)/x'; | |
| 38 | } | ||
| 39 | |||
| 40 | 1 | 1; | |