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

From time to time, I use https://metacpan.org/pod2html to check my POD. Recently, I noticed some strange behavior:

The following code renders as expected:

package FOO; use strict; use warnings; sub foo { my $str = shift; return $str if $str =~ /^ssh\@github-/; } 1; __END__ =head1 NAME Foo - The great Foo module

But if i change the "return" line like this, simply adding a \. to the regexp:

return $str if $str =~ /^\.ssh\@github-/;

then i get "Error rendering POD - "

The error disappears when i use parens:

return $str if ($str =~ /^\.ssh\@github-/);

Or, when i change the string "ssh" to something else, no error occurs:

return $str if $str =~ /^\.sh\@github-/;

No error with the line above!

What's going on here? I would expect a POD renderer not to look at the active code at all. Is there perhaps a hidden feature that I'm conflicting with here?

Replies are listed 'Best First'.
Re: Strange behavior of POD online renderer https://metacpan.org/pod2html
by ikegami (Patriarch) on Feb 19, 2026 at 17:05 UTC

    Works fine when using pod2html from the command line.

    Maybe some kind of attack detection is running amok?

      pod2html reports errors by including something akin to the following in the output:

      <h1 id="POD-ERRORS">POD ERRORS</h1> <p>Hey! <b>The above document had some coding errors, which are explai +ned below:</b></p> <dl> <dt id="Around-line-16">Around line 16:</dt> <dd> <p>Unterminated C&lt;...&gt; sequence</p>

      MetaCPAN's handler for the pod2html web tool parses the generated output to extract this. Another possibility is a that this goes awry.