I have this script
#!/usr/bin/perl
use warnings;
use strict;
use Data::Dumper;
use YAML::Syck;
my $x = {'x' => [1,2,3],
'y' => {'z' => 8},
'q' => 'abc',
};
my $yaml = YAML::Syck::Load($x);
print "\n" . $yaml . "\n\n\n";
my $h = YAML::Syck::Dump($yaml);
print Dumper $h;
which outputs
HASH(0x7539cb0)
$VAR1 = '--- HASH(0x7539cb0)
';
I’d expected to see the structure of $x which content. What’s wrong there?
You should use
Dumpto dump a Perl data structure into YAML andLoadto do the opposite.Try: