The function show
is automatically exported when use Data::Show;
is executed. This function takes a variable as its sole argument and it outputs:
show
is run fromshow
is run fromAssuming that the following is code from the file example.pl
:
use strict;
use warnings;
use Data::Show;
my @array = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
my %hash = ( foo => 1, bar => { baz => 10, qux => 20 } );
my $href = \%hash;
show @array;
show %hash;
show $href;
perl example.pl
gives the following output:
======( @array )=======================[ 'example.pl', line 11 ]======
[1 .. 10]
======( %hash )========================[ 'example.pl', line 12 ]======
{ bar => { baz => 10, qux => 20 }, foo => 1 }
======( $href )========================[ 'example.pl', line 13 ]======
{ bar => { baz => 10, qux => 20 }, foo => 1 }
See the documentation for Data::Show
.