From: Arthur Axel 'fREW' Schmidt Date: Fri, 23 Jul 2010 03:19:39 +0000 (-0500) Subject: Add doc for DwarnN and release X-Git-Tag: v2.001^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FData-Dumper-Concise.git;a=commitdiff_plain;h=9469b5b08a5f4294df2036931af772deb07def04 Add doc for DwarnN and release --- diff --git a/Changes b/Changes index 6cfdeda..9e9fda6 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +2.001 Jul 23 2010 + - add documentation for DwarnN + +2.000 Jul 22 2010 - remove Dumper() returning object - add DwarnN - add DwarnL diff --git a/lib/Data/Dumper/Concise.pm b/lib/Data/Dumper/Concise.pm index cecc57c..00364a7 100644 --- a/lib/Data/Dumper/Concise.pm +++ b/lib/Data/Dumper/Concise.pm @@ -2,7 +2,7 @@ package Data::Dumper::Concise; use 5.006; -$VERSION = '2.000'; +$VERSION = '2.001'; require Exporter; require Data::Dumper; @@ -58,8 +58,8 @@ Data::Dumper::Concise will give you: instead of the default Data::Dumper output: $VAR1 = { - 'quux' => sub { "DUMMY" }, - 'foo' => 'bar + 'quux' => sub { "DUMMY" }, + 'foo' => 'bar baz' }; diff --git a/lib/Data/Dumper/Concise/Sugar.pm b/lib/Data/Dumper/Concise/Sugar.pm index 75870a5..ef9d939 100644 --- a/lib/Data/Dumper/Concise/Sugar.pm +++ b/lib/Data/Dumper/Concise/Sugar.pm @@ -73,12 +73,26 @@ is equivalent to: warn Dumper(@return); return @return; +If you want to label your output, try DwarnN + + use Data::Dumper::Concise::Sugar; + + return DwarnN $foo + +is equivalent to: + + use Data::Dumper::Concise; + + my @return = some_call(...); + warn '$foo => ' . Dumper(@return); + return @return; + =head1 DESCRIPTION use Data::Dumper::Concise::Sugar; -will import Dwarn, DwarnL, and DwarnS into your namespace. Using L, so see -its docs for ways to make it do something else. +will import Dwarn, DwarnL, DwarnN, and DwarnS into your namespace. Using +L, so see its docs for ways to make it do something else. =head2 Dwarn @@ -92,6 +106,10 @@ its docs for ways to make it do something else. sub DwarnS ($) { warn Data::Dumper::Concise::Dumper $_[0]; $_[0] } +=head2 DwarnN + + sub DwarnN { warn '$argname => ' . Data::Dumper::Concise::Dumper $_[0]; $_[0] } + =head1 TIPS AND TRICKS =head2 global usage diff --git a/lib/Devel/Dwarn.pm b/lib/Devel/Dwarn.pm index 7f32a10..8211cf1 100644 --- a/lib/Devel/Dwarn.pm +++ b/lib/Devel/Dwarn.pm @@ -11,7 +11,8 @@ sub import { Devel::Dwarn - return Dwarn @return_value =head1 SYNOPSIS - use Data::Dumper::Concise::Sugar; + + use Devel::Dwarn; return Dwarn some_call(...) @@ -31,7 +32,7 @@ is equivalent to: but shorter. If you need to force scalar context on the value, - use Data::Dumper::Concise::Sugar; + use Devel::Dwarn; return DwarnS some_call(...) @@ -45,7 +46,7 @@ is equivalent to: If you need to force list context on the value, - use Data::Dumper::Concise::Sugar; + use Devel::Dwarn; return DwarnL some_call(...) @@ -57,6 +58,20 @@ is equivalent to: warn Dumper(@return); return @return; +If you want to label your output, try DwarnN + + use Devel::Dwarn; + + return DwarnN $foo + +is equivalent to: + + use Data::Dumper::Concise; + + my @return = some_call(...); + warn '$foo => ' . Dumper(@return); + return @return; + =head1 TIPS AND TRICKS =head2 global usage