3 use Data::Dumper::Concise::Sugar;
6 Data::Dumper::Concise::Sugar->export_to_level(1, @_);
11 Devel::Dwarn - Combine warns and Data::Dumper::Concise
17 return Dwarn some_call(...)
21 use Data::Dumper::Concise;
24 my @return = some_call(...);
28 my $return = some_call(...);
33 but shorter. If you need to force scalar context on the value,
37 return DwarnS some_call(...)
41 use Data::Dumper::Concise;
43 my $return = some_call(...);
47 If you need to force list context on the value,
51 return DwarnL some_call(...)
55 use Data::Dumper::Concise;
57 my @return = some_call(...);
61 If you want to label your output, try DwarnN
69 use Data::Dumper::Concise;
71 my @return = some_call(...);
72 warn '$foo => ' . Dumper(@return);
75 If you want to output a reference returned by a method easily, try $Dwarn
77 $foo->bar->{baz}->$Dwarn
81 my $return = $foo->bar->{baz};
85 If you want to immediately die after outputting the data structure, every
86 Dwarn subroutine has a paired Ddie version, so just replace the warn with die.
89 DdieL 'foo', { bar => 'baz' };
91 =head1 TIPS AND TRICKS
95 Instead of always just doing:
103 perl -MDevel::Dwarn foo.pl
105 (and then in the perl code:)
109 That way, if you leave them in and run without the C<< use Devel::Dwarn >>
110 the program will fail to compile and you are less likely to check it in by
111 accident. Furthmore it allows that much less friction to add debug messages.
113 =head2 method chaining
115 One trick which is useful when doing method chaining is the following:
118 $foo->bar->baz->Devel::Dwarn::DwarnS->biff;
120 which is the same as:
123 (DwarnS $foo->bar->baz)->biff;
127 This module is really just a shortcut for L<Data::Dumper::Concise::Sugar>, check
128 it out for more complete documentation.