1Data::Dumper::Concise::USsuegrarC(o3n)tributed Perl DocuDmaetnat:a:tDiuomnper::Concise::Sugar(3)
2
3
4

NAME

6       Data::Dumper::Concise::Sugar - return Dwarn @return_value
7

SYNOPSIS

9         use Data::Dumper::Concise::Sugar;
10
11         return Dwarn some_call(...)
12
13       is equivalent to:
14
15         use Data::Dumper::Concise;
16
17         my @return = some_call(...);
18         warn Dumper(@return);
19         return @return;
20
21       but shorter. If you need to force scalar context on the value,
22
23         use Data::Dumper::Concise::Sugar;
24
25         return DwarnS some_call(...)
26
27       is equivalent to:
28
29         use Data::Dumper::Concise;
30
31         my $return = some_call(...);
32         warn Dumper($return);
33         return $return;
34
35       Another trick that is extremely useful when doing method chaining is
36       the following:
37
38         my $foo = Bar->new;
39         $foo->bar->baz->Data::Dumper::Concise::Sugar::DwarnS->biff;
40
41       which is the same as:
42
43         my $foo = Bar->new;
44         (DwarnS $foo->bar->baz)->biff;
45

DESCRIPTION

47         use Data::Dumper::Concise::Sugar;
48
49       will import Dwarn and DwarnS into your namespace. Using Exporter, so
50       see its docs for ways to make it do something else.
51
52   Dwarn
53         sub Dwarn { warn Data::Dumper::Concise::Dumper @_; @_ }
54
55       DwarnS
56
57         sub DwarnS ($) { warn Data::Dumper::Concise::Dumper $_[0]; $_[0] }
58

SEE ALSO

60       You probably want Devel::Dwarn, it's the shorter name for this module.
61
62
63
64perl v5.12.0                      2010-02-13   Data::Dumper::Concise::Sugar(3)
Impressum