From 57c3ec309e46b2ba832147fa2163469a3d8042b8 Mon Sep 17 00:00:00 2001 From: "H.Merijn Brand" Date: Wed, 8 Oct 2008 09:48:09 +0200 Subject: [PATCH] Optionally install DP as shortcut for Data::Peek --- .gitignore | 3 ++- ChangeLog | 1 + MANIFEST.SKIP | 1 + Makefile.PL | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 55cf992..e275e93 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,8 @@ pm_to_blib *.gcov *.gcda *.gcno -DDumper-* +Data-Peek-* +DP.pm xx* .releaserc valgrind.log diff --git a/ChangeLog b/ChangeLog index 95c07fa..c236e9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * Renamed DDumper to Data::Peek * Default argument for DPeek is $_ + * Optionally install DP as shortcut for Data::Peek 2008-10-07 0.16 - H.Merijn Brand diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index 0be07ed..52db12a 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -8,6 +8,7 @@ \.gcno$ blib/ cover_db/ +DP.pm Makefile MANIFEST.SKIP pm_to_blib diff --git a/Makefile.PL b/Makefile.PL index 44fb783..a1c8fc2 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -29,6 +29,15 @@ my %wm = ( ); $ExtUtils::MakeMaker::VERSION > 6.30 and $wm{LICENSE} = "perl"; +unless (exists $ENV{AUTOMATED_TESTING} and $ENV{AUTOMATED_TESTING} == 1) { + if (prompt ("Do you want to install module DP as a shortcut for Data::Peek ?", "y") =~ m/[yY]/) { + open my $fh, ">", "DP.pm" or die "Cannot open DP.pm: $!\n"; + print $fh ; + close $fh; + $wm{clean}{FILES} .= " DP.pm"; + } + } + my $rv = WriteMakefile (%wm); 1; @@ -82,3 +91,36 @@ sub postamble '', $min_vsn; } # postamble + +__END__ +use Data::Peek; + +BEGIN { *DP:: = \%Data::Peek:: } +$VERSION = $DP::VERSION; + +1; + +=head1 NAME + +DP - Alias for Data::Peek + +=head1 SYNOPSIS + + perl -MDP -wle'print DPeek for DDual ($?, 1)' + +=head1 DESCRIPTION + +See L. + +=head1 AUTHOR + +H.Merijn Brand + +=head1 COPYRIGHT AND LICENSE + +Copyright (C) 2008-2008 H.Merijn Brand + +This library is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +=cut -- 2.11.4.GIT