Subject: | LoadFile on empty file dies |
$ touch abc.yaml
$ perl -MYAML::XS -e 'YAML::XS::LoadFile("abc.yaml")'
Usage: YAML::XS::LibYAML::Load(yaml_sv) at
/usr/local/lib64/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/YAML/XS.pm
line 70.
I think that probably the stated line (XS.pm line 70) passes an empty
list to Load when given an empty file:
return YAML::XS::LibYAML::Load(do { local $/; <$IN> })
This seems to fix it:
return YAML::XS::LibYAML::Load(do { local $/; join '', <$IN> })