Skip to content

Pod::Simple::HTMLBatch: each on anonymous hash will always start from the beginning #190

@gregoa

Description

@gregoa

We have the following bug reported to the Debian package of
Pod-Simple, c.f. https://bugs.debian.org/1114492

It doesn't seem to be a bug in the packaging, so you may want to take
a look. Thanks!

------8<-----------8<-----------8<-----------8<-----------8<-----

Package: libpod-simple-perl
Version: 3.45-1
Severity: normal
Control: affects -1 libpod-webserver-perl
Control: clone -1 -2
Control: reassign -2 perl 5.40.1-6
Control: block -2 with -1

The Pod::Simple::HTMLBatch module in this package has suspicious code
that generates a warning at compile time:

 $ perl -w -e 'use Pod::Simple::HTMLBatch'
 each on anonymous hash will always start from the beginning at /usr/share/perl5/Pod/Simple/HTMLBatch.pm line 725.

The code in question reads like this:

  for (my ($outfile, $variation) = each %{{
      blkbluw => 'black_with_blue_on_white',
      whtpurk => 'white_with_purple_on_black',
      whtgrng => 'white_with_green_on_grey',
      grygrnw => 'grey_with_green_on_white',
  }}) { ... }

This looks like a real bug; compare:

  % perl -wE 'for (my ($k, $v) = each %{{a=>1,b=>2,c=>3}}) { say "$k: $v"}'
  each on anonymous hash will always start from the beginning at -e line 1.
  b: 2
  b: 2

The code seems to have been introduced somewhere between 3.35 and 3.40,
but I didn't look into it more closely.

Given it's been like this for quite a while, I suppose nothing much really
uses that code. It should probably still be fixed.

The bug is also present in the version bundled with Perl, but it needs to
be fixed in the separate package first (otherwise a buggy version would
override a fixed one on the Perl search path.) I'm cloning a separate
bug for src:perl.

This was noticed because Pod::Webserver uses the Pod::Simple::HTMLBatch
module, so using it generates the same warning. I'm therefore marking
the libpod-webserver-perl package as affected by this.

I understand libpod-webserver-perl now has a workaround for the resulting
autopkgtest failure; that can eventually be dropped once the bug is fixed.
-- 
Niko Tyni   [email protected]


------8<-----------8<-----------8<-----------8<-----------8<-----

Thanks for considering,
gregor herrmann,
Debian Perl Group

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions