I would like to extend this with a request from a module maintainer: when sending a bug report the easiest for me (and I suspect for other module authors too) is to have a self-contained script, with the data in the __DATA__ section:
This is an example of a great bug report I received a while ago:
This code works fine:
-------->8-------->8-------->8-------->8
use XML::Twig;
$twig=XML::Twig->new(#keep_encoding=>1,
twig_handlers=>{
'[@a]' => sub {warn "a handler\n"},
});
$xml=join ('', <DATA>);
$twig->parse($xml);
__DATA__
<?xml version="1.0"?>
<!DOCTYPE doc SYSTEM "dummy.dtd">
<doc>
&ent1;
<elt1 a="Y"/>
</doc>
-------->8-------->8-------->8-------->8
and generates:
a handler
However, if the keep_encoding is uncommented, then it produces this er
+ror:
Can't use string ("ent1") as a HASH ref while "strict refs" in use at
+/local/share/oed/lib/perl/XML/Twig.pm line 1251, <DATA> line 6.
With this I can just save the code and start working on the problem.
Even better is a report where the code can be used asis as a non-regression test (I have no example of this but it has been known to happen).
The exact environment is also very important. This includes the OS and the version of Perl, but other factors can be just as important: for XML::Twig (just a random example ;--) the version of XML::Parser and of libexpat are needed.
Oh, and patches are welcome too ;--) |