Subject: | YAML::Dumper synopsis should contain "use YAML" |
Running the example in the YAML::Dumper synopsis...
#!/usr/bin/perl
use YAML::Dumper;
my $dumper = YAML::Dumper->new;
$dumper->indent_width(4);
print $dumper->dump({foo => 'bar'});
...fails for me with...
Can't locate object method "global_object" via package "YAML" at
/usr/lib/perl5/site_perl/5.8.8/YAML/Dumper.pm line 148.
If the synopsis example does a "use YAML;" otoh...
#!/usr/bin/perl
use YAML;
use YAML::Dumper;
my $dumper = YAML::Dumper->new;
$dumper->indent_width(4);
print $dumper->dump({foo => 'bar'});
...it works fine.
Assuming this isn't just me, I guess the easiest fix is perhaps to
change the synopsis to include "use YAML;"
This is perl 5.8.8, FC5, YAML 0.58.
Exact same results on 5.8.6, OS X 10.4, YAML 0.58.