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 | |
by ikegami (Patriarch) on Feb 19, 2026 at 17:17 UTC |