Package: libxml-twig-perl
Version: 1:3.39-1
Severity: normal

Dear Maintainer,

I've found few mistypings in /usr/share/perl5/XML/Twig.pm that don't affect me
yet, but they are logic errors, so it will be good to correct them.

I've made a little patch to correct them.

Here is a brief explanation:

>> _utf8_ify( $match) if( $[ < 5.010);

$[ shows where array starts ( 0 or 1 )
$] shows perl version.

I think, that author wanted there to compare perl version, not where array
starts.

Thanks in advance.



-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-4-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libxml-twig-perl depends on:
ii  libxml-parser-perl  2.41-1+b1
ii  perl                5.14.2-15

Versions of packages libxml-twig-perl recommends:
ii  libhtml-parser-perl      3.69-2
ii  libtext-iconv-perl       1.7-5
ii  libtie-ixhash-perl       1.21-2
ii  libwww-perl              6.04-1
ii  libxml-xpathengine-perl  0.13-1

Versions of packages libxml-twig-perl suggests:
pn  libunicode-map8-perl    <none>
ii  libunicode-string-perl  2.09-5
pn  xml-twig-tools          <none>

-- no debconf information
--- /usr/share/perl5/XML/Twig.pm	2011-10-01 19:24:41.000000000 +0300
+++ /home/xenomorph/perl/Twig.pm	2012-11-27 10:03:07.000000000 +0200
@@ -7283,13 +7283,13 @@
         { $text= pop @matches;
           if( $previous_match)
             { # match, not the first one, create a new text ($gi) element
-              _utf8_ify( $pre_match) if( $[ < 5.010);
+              _utf8_ify( $pre_match) if( $] < 5.010);
               $elt= $elt->insert_new_elt( after => $gi, $pre_match);
               push @result, $elt if( $return_all);
             }
           else
             { # first match in $elt, re-use $elt for the first sub-string
-              _utf8_ify( $pre_match) if( $[ < 5.010);
+              _utf8_ify( $pre_match) if( $] < 5.010);
               $elt->set_text( $pre_match);
               $previous_match++;                # store the fact that there was a match
               push @result, $elt if( $return_all);
@@ -7301,7 +7301,7 @@
               my $i=0;
               foreach my $match (@matches)
                 { # create new element, text is the match
-                  _utf8_ify( $match) if( $[ < 5.010);
+                  _utf8_ify( $match) if( $] < 5.010);
                   my $tag  = $tags[$i]->{tag};
                   my $atts = \%{$tags[$i]->{atts}} || {};
                   $elt= $elt->insert_new_elt( after => $tag, $atts, $match);

Reply via email to