Data-Show reviews


RSS | Module Info | Add a review of Data-Show

Data-Show (0.002003) *****

thanks, Damian,
very handy module,
I like your tricks very much:

use Data::Show;
my $file = $ARGV[0] or die "Need to get CSV file on the command line\n";
$slurp_text = slurp($file);

sub slurp {

my ($abs_file_path) = @_;

open my $fh, '<', $abs_file_path or croak $!;

local $/;

my $text = <$fh>;

my %contents_of = do { local $/; "", split /\[(\S+)\]\n/, $slurp_text };

show %contents_of;

Data-Show (0.001001) *****

As always with Damien's modules, there is more than the eye can see.

Have a look at the implementation; I think that's where the payload is.

I'll shamelessly say that Data::TreeDumper will do more and certainly present large amount of data in a, IMVHO, better way. DISPLAY_CALLER_LOCATION => 1 in the argument list (create your own dump function or curry the one from D::TD) will also display the call line.

There are a bunch of dump modules on CPAN, look them up too.

Still, if you are OK with the implementation, did I already say to have a peep?, this can certainly be helpful.

Data-Show (0.001001) *****

brian d foy may have said that "plain ol' print" was the "best debugger" in his book Mastering Perl. But I think that was only because Data::Show had not been invented yet.

Data::Show gives you (1) the name of the variable you want to "show", (2) the contents of that variable in a readable format, (3) the line the variable is located on, and (4) the file that line is located in.

What more could you want to help simplify your debugging?