4

The perlpod documentation tells me that I can link to URLs using L<scheme:...> or L<text|scheme:...>, it even lists L<The Perl Home Page|http://www.perl.org/> as an example.

The first case works fine for me: pod2html turns

L<http://example.com/>

into

<a href="http://example.com/">http://example.com/</a>

But it fails on

L<example|http://example.com/>

which is just turned into

<em>example</em>

along with a warning:

/usr/bin/pod2html: : cannot resolve L<example|http://example.com/> in paragraph 2.

I would have expected something like

<a href="http://example.com/">example</a>

to be produced. How can I achieve that?

UPDATE So this seems to be a bug in Pod::Html as Alan Haggai Alavi points out. Is there a workaround?

Jonas
  • 121,568
  • 97
  • 310
  • 388
hillu
  • 9,423
  • 4
  • 26
  • 30

2 Answers2

7

It indeed was a bug in Pod::Html. It has been fixed in bleadperl.

Now L<example|http://example.com/> gets converted to <a href="http://example.com/">example</a>.

Since Pod::Html is a pure Perl module, the files can be copied from bleadperl which will give you version 1.12. The module shipped with with perlv5.14.2 is version 1.11 and exhibits this bug.

Else, you can use Pod::Simple::Html which works as expected.

Alan Haggai Alavi
  • 72,802
  • 19
  • 102
  • 127
-1

use it like

L<< example|http://example.com/ >>
yb007
  • 1,377
  • 2
  • 11
  • 17