Commit | Line | Data |
60e18490 |
1 | package Devel::Dwarn; |
2 | |
2570b7be |
3 | use Data::Dumper::Concise::Sugar; |
60e18490 |
4 | |
d71b0a31 |
5 | sub import { |
6 | Data::Dumper::Concise::Sugar->export_to_level(1, @_); |
7 | } |
60e18490 |
8 | |
dc06d25b |
9 | =head1 NAME |
10 | |
11 | Devel::Dwarn - return Dwarn @return_value |
12 | |
13 | =head1 SYNOPSIS |
14 | |
15 | use Devel::Dwarn; |
16 | |
17 | return Dwarn some_call(...) |
18 | |
19 | is equivalent to: |
20 | |
21 | use Data::Dumper::Concise; |
22 | |
23 | my @return = some_call(...); |
24 | warn Dumper(@return); |
25 | return @return; |
26 | |
27 | but shorter. If you need to force scalar context on the value, |
28 | |
29 | use Devel::Dwarn; |
30 | |
31 | return DwarnS some_call(...) |
32 | |
33 | is equivalent to: |
34 | |
35 | use Data::Dumper::Concise; |
36 | |
37 | my $return = some_call(...); |
38 | warn Dumper($return); |
39 | return $return; |
40 | |
01223632 |
41 | Another trick that is extremely useful when doing method chaining is the |
42 | following: |
43 | |
44 | my $foo = Bar->new; |
45 | $foo->bar->baz->Devel::Dwarn::DwarnS->biff; |
46 | |
47 | which is the same as: |
48 | |
49 | my $foo = Bar->new; |
50 | (DwarnS $foo->bar->baz)->biff; |
51 | |
dc06d25b |
52 | =head1 SEE ALSO |
53 | |
54 | This module is really just a shortcut for L<Data::Dumper::Concise::Sugar>, check |
55 | it out for more complete documentation. |
56 | |
57 | =cut |
58 | |
60e18490 |
59 | 1; |