Troff turns ^
into a circumflex accent.
The simple solution to your issue, with a not-so-simple implementation, is to arrange that every ^
in the pod file gets turned into the troff sequence \(ha
.
I don't know the internals of Pod.pm
, so instead of patching that I'll give a filter you can use on the output of pod2man
, before it gets sent to man -t
.
Complicating matters is that pod2man
produces some lines with ^
in them. We can't alter them.
pod2man foo.pod | \
perl -pe '/\.[ ]*ds[ ]*\^/ || s/(?<!\\\*)\^/\\(ha/g' | \
man -tl - | ps2pdf - foo.pdf
The Perl command does this:
- if the line contains a
.ds ^
directive, don't alter it
- otherwise, every occurrence of
^
is replaced by \(ha
, but \*^
isn't touched.