Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Can someone explain this weird Pod::Html bug?

by tachyon (Chancellor)
on Nov 30, 2001 at 14:57 UTC ( [id://128592]=perlquestion: print w/replies, xml ) Need Help??

tachyon has asked for the wisdom of the Perl Monks concerning the following question:

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

Replies are listed 'Best First'.
Re: Can someone explain this weird Pod::Html bug?
by stefan k (Curate) on Nov 30, 2001 at 15:14 UTC
    I'm not really good at this but I have once hunted a bug with pod which was the result of different line endings. Maybe you should try to run it through recode once or remove all CRs (perl -pi.bak -e 's/\r//g') or the like.
    Again: I can't promise that this is _it_, still it might be worth a try.

    Regards... Stefan
    you begin bashing the string with a +42 regexp of confusion

      Thanks stefan_k but I have already done that. The first thing the problem script does is recurse the tree and standardise all the line endings to \012. It also fixes the annoying /^\s+\012/ blank lines (but with spaces) that choke pod2html.

      Update - ++ stefan_k

      I looked at my code and the s/\015\012/\012/g is run AFTER the calls to pod2html. Do it first and.....problem solved

      cheers

      tachyon

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

Re: Can someone explain this weird Pod::Html bug?
by japhy (Canon) on Nov 30, 2001 at 15:10 UTC
    Whatever it is, it's fixed in bleadperl. I'd suggest upgrading to 5.6.1, perhaps.

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://128592]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-24 04:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found