I wrote a little script for my home site at perlmonk.org to automatically pod2html my public scripts and modules, write the index pages, etc. Just another day in the office. OK so it all works fine under Win32. When I upload it and try to run it under Free BSD 4.04 it breaks. As I said the script is writing HTML from the pod of a number of scripts. It breaks because pod2html is not writing any HTML for the script itself (which has pod). OK I think, there is some OS related problem with pod2html(ing) a running script. Not so.

After several frustrating hours I have isolated the follwing bug:

bash-2.05$ cat test1.pl =head2 PASS You can pod2html this =cut bash-2.05$ perl -MPod::Html -e 'pod2html("--infile=./test1.pl")' -e: no title for ./test1.pl at /usr/libdata/perl/5.00503/Pod/Html.pm l +ine 330. <HTML> <HEAD> <TITLE>./test1.pl</TITLE> <LINK REV="made" HREF="mailto:hackers@FreeBSD.org"> </HEAD> <BODY> [snip] </BODY> </HTML> bash-2.05$

OK so far, that works as expected, but....

bash-2.05$ cat test2.pl use Pod::Html; =head2 FAIL You can't pod2html this =cut bash-2.05$ perl -MPod::Html -e 'pod2html("--infile=./test2.pl")' bash-2.05$

As you can see this produces no output! But wait, it gets even more odd....

bash-2.05$ cat test3.pl # pod2html - not even in comments? =head2 FAIL You can't pod2html this =cut bash-2.05$ perl -MPod::Html -e 'pod2html("--infile=./test3.pl")' bash-2.05$

As you can see with the test cases Pod::Html breaks and fails to write HTML from valid pod if the strings Pod::Html or pod2html appear seemingly anywhere in the source code. Raw call, in a quoted string or print, even in comments!

Why is it so? I have RTFS and have NFI. It is system dependent as it occurs running under Free BSD but not Win32. Although not shown above I locally installed exactly the same version of Pod::Html used on Win32 on the Free BSD system and the problem still remains.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Can someone explain this weird Pod::Html bug? by tachyon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.