(note or diag) explain( a_variable );


Its result must be passed to either note(); does or diag();


examples/test-more/t/explain.t
use strict;
use warnings;

use Test::More tests => 1;

ok 1;

my $x = "String data";
my @y = ( 1, 2, 3 );
my %h = (
    foo => 'bar',
    numbers => [ 42, 17 ],
);

diag $x;
diag \@y;
diag \%h;

diag explain $x;
diag explain \@y;
note explain \%h;

perl t/explain.t


1..1
ok 1
# String data
# ARRAY(0x5573692156f8)
# HASH(0x5573691b5b80)
# String data
# [
#   1,
#   2,
#   3
# ]
# {
#   'foo' => 'bar',
#   'numbers' => [
#     42,
#     17
#   ]
# }