File Coverage

blib/lib/Data/Tersify/perldb.pm
Criterion Covered Total %
statement 9 10 90.0
branch n/a
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 15 80.0


line stmt bran cond sub pod time code
1             package Data::Tersify::perldb;
2              
3 1     1   1699 use strict;
  1         2  
  1         31  
4 1     1   5 use warnings;
  1         2  
  1         26  
5              
6 1     1   5 use Data::Tersify;
  1         2  
  1         87  
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 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             sub DB::afterinit {
37 0     0 0   $DB::alias{x} = 's/^ x \s (.+) /x Data::Tersify::tersify_many($1)/x';
38             }
39              
40             1;