Re: removing POD docs from modules
by PodMaster (Abbot) on Oct 31, 2002 at 14:05 UTC
|
I wrote Pod::Stripper to do just that, strip pod.
Here's a tip on searching CPAN, look for all distributions containing your subject (like this).
update:
I did a little test, took my perl5.8, and removed all html/pod files, and stripped pod out of every .pm, and my perl directory went from about 40mb to about 18mb. None of the modules broke as far as I know , and I ran a few test ( although some heredocs might be missing ;D )
____________________________________________________ ** The Third rule of perl club is a statement of fact: pod is sexy. | [reply] |
|
|
Cool, as an act of pure conceptual art.
However, I wouldn't want to do any work on your system where perldoc Any::Module returns just No documentation found for "Any::Module".
BTW, how many cents worth of storage did you save? Less than one (non-free) beer I bet. Unless you're preparing embedded perl for the next-gen chipcards, in which case I'm utterly impressed!
--
Cheers Joe ;-)
| [reply] [d/l] |
|
|
However, I wouldn't want to do any work on your system where perldoc Any::Module returns just No documentation found for "Any::Module".
Then put the stripped POD into a .pod file. In other words: put what you extract from Any/Module.pm into a file Any/Module.pod. It works just as dandy with perldoc.
| [reply] |
|
|
|
|
Cool, thanks. Actually I did that exact search on CPAN already, and I remember looking at that page, but I guess I missed that reference at the bottom ;)
My bad...
| [reply] |
Re: removing POD docs from modules
by Abigail-II (Bishop) on Oct 31, 2002 at 13:47 UTC
|
I doubt you will accomplish anything serious, but you could do:
perl -00 -i -ne 'print unless /^=\w/ .. /^=cut/' *.p[ml]
This might erase legitimate code, but it won't be worse
that a POD converter.
Abigail | [reply] [d/l] |
Re: removing POD docs from modules
by broquaint (Abbot) on Oct 31, 2002 at 13:54 UTC
|
You could do something hackish like
find /your/perl/lib/path -name '*.pm' | \
xargs perl -ni -e 'print unless /^=\w+/ .. /^=cut/'
Which works for me, but is *not* a reliable solution. A saner approach would almost certainly involve modules, perhaps subclassing Pod::Simple would do the trick.
update: or use crazyinsomniac's Pod::Stripper. ahem.
HTH
_________ broquaint | [reply] [d/l] |
Re: (nrd) removing POD docs from modules
by newrisedesigns (Curate) on Oct 31, 2002 at 13:55 UTC
|
What is there to gain in doing this? The amount of space saved is near insignificant. You will be removing a lot of valuable information: technical documentation, requirements, bug info, and author credit.
If this is really such a hair-splitting issue, why don't you use a text editor to remove the POD from the modules that you see as having excessive documentation?
John J Reiser
newrisedesigns.com
| [reply] |
|
|
The amount of space saved is near insignificant.
I'm sure there are many modules where the savings would be neglible, but POD makes up 1/2 of CGI.pm and LWP::UserAgent. If that were true for the majority of modules out there, that's a very significant savings, especially if you're playing in enviroments where space is at a premium (embeded systems, flash cards, install CDs).
That said, you can save far more space by whittling down a lot of the excess baggage in core distribution than by stripping POD (as touched on in this p5p thread); although doing both should make for a really minimalist Perl install! ;)
--k.
| [reply] |