use warnings FATAL => 'all';
all_from 'lib/Data/Dumper/Concise.pm';
-requires 'Devel::ArgNames' => 0.03;
WriteAll;
use Exporter ();
use Data::Dumper::Concise ();
-use Devel::ArgNames;
BEGIN { @ISA = qw(Exporter) }
-@EXPORT = qw($Dwarn Dwarn DwarnS DwarnL DwarnN);
+@EXPORT = qw($Dwarn $DwarnN Dwarn DwarnS DwarnL DwarnN);
sub Dwarn { return DwarnL(@_) if wantarray; DwarnS($_[0]) }
our $Dwarn = \&Dwarn;
+our $DwarnN = \&DwarnN;
sub DwarnL { warn Data::Dumper::Concise::Dumper @_; @_ }
sub DwarnS ($) { warn Data::Dumper::Concise::Dumper $_[0]; $_[0] }
sub DwarnN ($) {
- my $x = arg_names();
+ require Devel::ArgNames;
+ my $x = Devel::ArgNames::arg_names();
warn(($x?$x:'(anon)') . ' => ' . Data::Dumper::Concise::Dumper $_[0]); $_[0]
}
$Dwarn = \&Dwarn
+=head2 $DwarnN
+
+ $DwarnN = \&DwarnN
+
=head2 DwarnL
sub Dwarn { warn Data::Dumper::Concise::Dumper @_; @_ }
sub DwarnN { warn '$argname => ' . Data::Dumper::Concise::Dumper $_[0]; $_[0] }
+B<Note>: this requires L<Devel::ArgNames> to be installed.
+
=head1 TIPS AND TRICKS
=head2 global usage
can_ok __PACKAGE__, qw{Dwarn DwarnS DwarnL DwarnN};
can_ok 'Devel::Dwarn', qw{Dwarn DwarnS DwarnL DwarnN};
-ok($Dwarn, 'Coderef gets exported too');
+ok($Dwarn, '$Dwarn gets exported');
+ok($DwarnN, '$DwarnN gets exported');