Subject: | perl -w vs some bad xml |
Date: | Sat, 15 May 2010 09:36:48 +1000 |
To: | bug-XML-Liberal [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With XML::Liberal 0.22 and recent debian perl 5.10.1 the program foo.pl
below run as
perl -w foo.pl
gets warnings
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/XML/Liberal/Remedy/ControlCode.pm line 19.
Use of uninitialized value in concatenation (.) or string at /usr/share/perl5/XML/Liberal/Remedy/ControlCode.pm line 19.
Can't find control code line : at /usr/share/perl5/XML/Liberal.pm line 74
where I think I hoped if it couldn't make a fix that it wouldn't say
anything.
The offending xml
<foo>abc
is an unclosed tag at eof. I struck this from a truncated RSS download.
I'm not sure if I actually want XML::Liberal to fix it.
#!/usr/bin/perl -w
use strict;
use warnings;
use XML::Liberal;
print "XML::Liberal ", XML::Liberal->VERSION, "\n";
my $parser = XML::Liberal->new('LibXML');
eval { $parser->parse_string('<foo>abc') };
print "done\n";