in reply to dumping variables automatically with their name?
The actual dumping is done by Data::Dumper, so setting all Data::Dumper options will control the output. It should be easy enough to replace the output with Data::Dump, or Data::Dumper::Simple, or even JSON or YAML, or any of the other 100 ways to dump out data. We used Data::Dumper because 11 years ago it was what there was.$ cat sample.pl use strict; use CGI::Ex::Dump qw(debug); my $a = 123; my @b = qw(1..10); my $obj = bless {}, __PACKAGE__; debug; debug $a, \@b, $obj; debug "Arbitrary String "x2; debug {"a".."f"}; $ perl sample.pl debug: sample.pl line 6 debug: sample.pl line 7 $a = 123; \@b = [ "1..10" ]; $obj = bless( {}, 'main' ); debug: sample.pl line 8 String = "Arbitrary String Arbitrary String "; debug: sample.pl line 9 {"a".."f"} = { a => "b", c => "d", e => "f" };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: dumping variables automatically with their name?
by LanX (Saint) on Mar 31, 2014 at 19:54 UTC |