I've many times had difficulty in Pod writing method docs when you want to type:
Call the method C<Foo->constructor($parameter)> to get a C<Foo> thing back.
The problem with that is the C<> section that the parser sees is just C<Foo->.
What I used to do is play tricks with E<> to try and get it to all work. But there's an easier way. In pod you can use multiple brackets followed by whitespace as delimiters, so the above becomes:
Call the method C<< Foo->constructor($parameter) >> to get a C<Foo> thing back.
Hopefully this will help someone else out in authoring their Pod API docs.
Oooh, I've been useing that for ages... (Score:3, Interesting)
Infact, the inablility to write code easily in XML is one of the main reasons that I wrote the entire of the advent calendar in POD not XML.
Reply to This
Re:Oooh, I've been useing that for ages... (Score:3, Interesting)
Hmmmm. You do know that you don't have to escape ">" in XML right? It's there if you need to, but only
&and<are really necessary. And I don't need "<" all that often in Perl...I routinely write code in XML, and I've rarely needed to escape anything. One reason is quoted above, another is that I wrap large pieces of code in
<![CDATA[...]]>anyway just so I don't have to worry about it. To be honest, I find I have to escape stuff in XML less often than I need to use the-- Robin Berjon [berjon.com]
Re:Oooh, I've been useing that for ages... (Score:3, Insightful)
But yeah, Pod is great for the sorts of use like the Advent calendar, and my AxKit Wiki.