I really, really appreciate the cpan-testers, they help me get my stuff tested.
Yesterday I received a report on a failure with my Games-Bingo.
I skimmed the report and I could not really see what test was failing. After reading it a few times I located this block which seemed to list the problem:
------------------------------
PROGRAM OUTPUT
------------------------------
Output from 'C:\strawberry\perl\bin\perl.exe ./Build':
Undefined fragment '0' (0) from fragment_id() in emit_item_tag() in blib\lib\Games\Bingo.pm at C:/strawberry/perl/lib/Pod/Html.pm line 1133
Pod::Html::emit_item_tag(0, 0, 1) called at C:/strawberry/perl/lib/Pod/Html.pm line 1193
Pod::Html::process_item(undef) called at C:/strawberry/perl/lib/Pod/Html.pm line 546
Pod::Html::pod2html('--flush', '--title=Games::Bingo - a bingo game Perl implementation', '--podpath=script:lib', '--infile=blib\lib\Games\Bingo.pm', '--outfile=blib\libhtml\site\lib\Games\Bingo.html', '--podroot=blib', '--htmlroot=../../../site', '--header', '--backlink=Back to Top', ...) called at C:/strawberry/perl/lib/Module/Build/Base.pm line 2719
This does to me not look at a failing test or problem in Games::Bingo.
The problem seems to be from the following POD:
These are the different values:
=over 4
=item * 0
Game is over
=item * 1
full card (the default)
=item * 2
2 rows
=item * 3
1 row
=back
And the culprit seems to be:
=item * 0
Games::Bingo passes POD tests, so now I have been presented with a problem I want to address.
So I would like to bring this forward to the right person, so who would this be?
David Landgren, maintainer of Pod::Html
or
Adam Kennedy, maintainer of Strawberry Perl
or
David Golden who sent the report and he has some interest in CPAN reporting, since the report present some problems.
1. The HTML generation is not a part of my test suite
2. I cannot read from the report what version of Html::Pod is failing might be having a problem
The complete report is available, suggestions are welcome...
Well, that's a heck of a tricky failure.
As the culprit (as it were), I would suggest the following:
=item 0
This is item 0
=item 1
This is item 1
And so on.
Use the pod2html preview to see how it looks.
-- dagolden
Re:What to do next
jonasbn on 2008-06-04T07:57:04
Hmmm, the POD does not even render as expected viewingperldoc
.
These are the different values:
=over 4
=item * 0
Game is over
=item * 1
full card (the default)
Renders to:
These are the different values:
o Game is over
o 1
full card (the default)
I do not understand why this is a problem and it might be more fundamental. I would expect=item * 0
to regard zero as a string/character since the*
(asterisk) is a parameter to=item
- so is this a POD bug/issue?
I did a quick test:
=pod
=head2 numerics
=over
=item 0
=item 1
=back
=head2 bullets
=over
=item * 0, zero
=item * 0
zero with text on new line
=item * 1, one
=back
=cut
And it seems as if=item
followed by*
followed by a newline does not work as the above variation=item * 0, zero
The output:
numerics
0
1
bullets
o 0, zero
o zero with text on new line
o 1, one
So perhaps a bug report should also be filed with perl/perldoc?
The above example is available for download.
Re:What to do next
dagolden on 2008-06-04T10:47:08
perlpodspec is pretty ambiguous about it. I think it implies that it should work, but it doesn't really say it. It's probably a bug.
Generally, I think it's best if one uses the "=item X" paragraph *only* for defining "the bullet" part of the list and using a separate paragraph afterwards for the content. E.g.
# a list of bulleted numbers
=over
=item *
0
=item *
0 is a number
=back--dagolden
Re:What to do next
Aristotle on 2008-06-04T10:57:40
Looks like someone is testing the string following the bullet with something like
if ( $headline )
as opposed toif ( defined $headline and length $headline )
. Check what happens if you say=item * Z<>0
.(In 5.12, the need for the
defined
will go away becauselength undef
will silently return undef rather than warning and returning 0.)But I agree with David that you should not put a bullet and headline on the
=item
line.