Next | Making Programs Faster | 56 |
perldoc is mostly just a wrapper around pod2man
It locates files and invokes pod2man and nroff as necessary
Let's find out how to run pod2man:
% strace -s10000 -f -o perldoc.trace perldoc perlfunc > /dev/null
This generates a list of every system call run by perldoc
In particular, it will tell us what commands perldoc ran
% grep execve perldoc.trace
21892 execve("/usr/local/bin/perldoc", ["perldoc", "perlfunc"], ...
21893 execve("/bin/sh", ["sh", "-c",
"/usr/local/bin/pod2man --lax /usr/local/lib/perl5/5.8.0/pod/perlfunc.pod | nroff -man"], ...
21894 execve("/usr/local/bin/pod2man",
["/usr/local/bin/pod2man", "--lax",
"/usr/local/lib/perl5/5.8.0/pod/perlfunc.pod"], ...
21895 execve("/usr/bin/nroff", ["nroff", "-man"], ...
Now let's run pod2man the same way:
% time /usr/local/bin/pod2man --lax /usr/local/lib/perl5/5.8.0/pod/perlfunc.pod > /dev/null
real 0m18.158s user 0m17.670s sys 0m0.080s
Yup
Probably a lot of the rest is in nroff
Presumably we're not prepared to do anything about nroff
Next | Copyright © 2003 M. J. Dominus |