On Saturday, November 9, 2002, at 12:51 , Michael G Schwern wrote:
On Thu, Oct 31, 2002 at 03:49:41PM +0000, Steve Purkis wrote:
[snip!]
But still, I thought you might find it of some use in your quest to
clean up MakeMaker ;-).  So the patch is attached.
I sort of see what you're doing here, this is just a cleanup, right? No new
features introduced?
That's right - in my haste I forgot to mention it.


If I could ask you to take another whack a this, modify your patch so that
rather than using the pod2man binary it uses the Pod::Man module. [1] If
nothing else it'll be a lot faster to have one process calling
Pod::Man->parse_from_file multiple times than calling pod2man once for each
individual POD file. [1]
Done, though I've split it up into 2 processes using Pod::Man - for section 1,
then section 3 pages. It was easier to specify the section num and the pods
to parse like that. I also fixed some pseudo-bugs I introduced:

s/$self->MY::method/$self->method/
2 x 'use strict;' statements (was that me?)

See the attached patch.


PS You might find these slides from the Refactoring talk useful or at least
amusing. They talk specificly about the icky POD2MAN code.
http://www.pobox.com/~schwern/talks/Refactoring/slides/slide020.html
Yikes - and I thought the cleaned up code was obfuscated!?  :-)  Well,
now I know.  Didn't mean to step on your toes here, BTW.  Just thought
that this would make it easier to understand.

As an aside, your slides are really useful - Greg M. pointed them out
to me a month or so back - the ones on testing (not to mention all the
other work you've done!) have been a great help here.

As another aside (which you've probably already thought of :) is that
MakeMaker could be cleaned up even further by the same process I've
used here, ie: breaking down large methods (like init_*) into smaller,
well-named chunks.  I also see space for a MakeTarget module (and
perhaps others), instead of bunging everything into one class.


[1] This means 5.5.3 users will have to install Pod::Man.  Oh well.
Life goes on... a user-friendly error in the embedded POD2MAN script
might help (or might be overkill, so I didn't add it - an exercise for the
reader :).


[2] 5.6.1 introduced a pod2man which could do multiple conversions in one
command. Unfortunately, we much be backwards compatible to 5.5.3.
What you've suggested above works fine. Besides - not having to maintain
code that finds pod2man is one less thing to maintain, however small it is.

-Steve

Attachment: ExtUtils-MM_Unix-1.33_manifypods-Pod-Man.patch
Description: Binary data

Reply via email to