Subject: | SGML parser |
Date: | Wed, 31 Mar 2010 08:58:02 -0700 (PDT) |
To: | bug-perlSGML.1997Sep [...] rt.cpan.org |
From: | Jamsheed Agahi <jambabea [...] yahoo.com> |
Hi,
I noticed that parse_data() method
in your SGML parser Perl
package - Parser.pm - doesn't properly
deal with the newline character
at the end of an input line. More
specifically, after an input line is
returned by _get_line(), it is parsed
and processed, but the $buf variable will
have the newline character in it, and therefore,
the following test:
if ($buf eq '') {
last LOOP unless defined($buf = $this->_get_line());
}
will fail, and $buf will not be updated.
This will cause an error like this:
Use of uninitialized value in string ne at /home/jambabe/perlSGML.1997Sep18/lib/SGML/Parser.pm line 259.
Here is a simple example:
<!DOCTYPE csrChptr SYSTEM "csr.dtd" []>
<csrChptr>
<csrAS id="CD000005">
<csrASTtl id="CT000005">chip</csrASTtl>
</csrASTtl>
</csrAS>
</csrChptr>
Environment details:
Distribution Name: perlSGML.1997Sep18
Perl version: v5.8.5 built for i386-linux-thread-multi
O.S version: Redhat Linux 2.6.9-89.0.11.ELsmp
Thanks,
Jamsheed