In your Makefile.pl file, you can add dependencies like so:
use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'Foo::Bar', 'VERSION_FROM' => 'Bar.pm', 'PREREQ_PM' => { Class::MethodMaker => 1.06 }, );
If the user is using the CPAN shell, it will prompt them if they want to queue and install Class::MethodMaker. I am sure that CPANPLUS will do this as well, but i have not tested it myself.

Class::MethodMaker is, IMHO, a wonderful module - but it is not the fastest way to use classes (for a processor, that is). Depending upon the number of classes you have to create, you might just want to go ahead and explicitly write the accessor methods yourself, if you think you won't have to do a lot of maintenance (yeah, right).

As for your second question, i know of no modules that will output the class as a text file ... sounds like a really good idea though. I like it. I recommend you check out the POOP mailing list. miyagawa is an active particpant, he might have more info for you.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to (jeffa) Re: Class::MethodMaker, CPAN and alternatives by jeffa
in thread Class::MethodMaker, CPAN and alternatives by anithri

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.