Subject: | XMLout($data, $fh) breaks when $fh is a filehandle, not an IO::Handle object |
When giving a "common" file handle as OutputFile value for XMLout, as
described in the POD:
open my $fh, '>:encoding(iso-8859-1)', $path or die "open($path):
$!";
XMLout($ref, OutputFile => $fh);
the script breaks with the error message:
Can't locate object method "print" via package "IO::Handle"
at /home/ccm_root/perl5.8/lib/5.8.6/XML/Simple.pm line 549.
It seems that there should be a test whether $fh is an IO::Handle
object or a file handle; in the latter case, a wrapper IO::Handle
object should be created.