| 1 | # This file is part of Devel::Cover. | ||
| 2 | |||
| 3 | # This software is free. It is licensed under the same terms as Perl itself. | ||
| 4 | |||
| 5 | # The latest version of this software should be available from my homepage: | ||
| 6 | # https://pjcj.net | ||
| 7 | |||
| 8 | # Author of this file: Olivier Mengué | ||
| 9 | |||
| 10 | package # Private module | ||
| 11 | Devel::Cover::Dumper; | ||
| 12 | |||
| 13 | use strict qw( vars subs ); # no refs | ||
| 14 | use warnings; | ||
| 15 | |||
| 16 | our $VERSION = '1.52'; # VERSION | ||
| 17 | |||
| 18 | sub import { | ||
| 19 | my $caller = caller; | ||
| 20 | if (defined &{"${caller}::Dumper"} && \&{"${caller}::Dumper"} != \&Dumper) { | ||
| 21 | require Carp; | ||
| 22 | Carp::croak("Data::Dumper previously imported. " | ||
| 23 | . "Use Devel::Cover::Dumper instead."); | ||
| 24 | } | ||
| 25 | *{"${caller}::Dumper"} = \&Dumper; | ||
| 26 | } | ||
| 27 | |||
| 28 | sub Dumper { | ||
| 29 | require Data::Dumper; | ||
| 30 | no warnings "once"; | ||
| 31 | local $Data::Dumper::Indent = 1; | ||
| 32 | local $Data::Dumper::Sortkeys = 1; | ||
| 33 | Data::Dumper::Dumper(@_); | ||
| 34 | } | ||
| 35 | |||
| 36 | 1 | ||
| 37 | |||
| 38 | __END__ |