1 package Data::Dumper::Concise::Sugar;
6 use Data::Dumper::Concise ();
8 BEGIN { @ISA = qw(Exporter) }
10 @EXPORT = qw(Dwarn DwarnS);
12 sub Dwarn { warn Data::Dumper::Concise::Dumper @_; @_ }
14 sub DwarnS ($) { warn Data::Dumper::Concise::Dumper $_[0]; $_[0] }
18 Data::Dumper::Concise::Sugar - return Dwarn @return_value
22 use Data::Dumper::Concise::Sugar;
24 return Dwarn some_call(...)
28 use Data::Dumper::Concise;
30 my @return = some_call(...);
34 but shorter. If you need to force scalar context on the value,
36 use Data::Dumper::Concise::Sugar;
38 return DwarnS some_call(...)
42 use Data::Dumper::Concise;
44 my $return = some_call(...);
48 Another trick that is extremely useful when doing method chaining is the
52 $foo->bar->baz->Data::Dumper::Concise::Sugar::DwarnS->biff;
57 (DwarnS $foo->bar->baz)->biff;
61 use Data::Dumper::Concise::Sugar;
63 will import Dwarn and DwarnS into your namespace. Using L<Exporter>, so see
64 its docs for ways to make it do something else.
68 sub Dwarn { warn Data::Dumper::Concise::Dumper @_; @_ }
72 sub DwarnS ($) { warn Data::Dumper::Concise::Dumper $_[0]; $_[0] }
76 You probably want L<Devel::Dwarn>, it's the shorter name for this module.