Hi monks,
I am wondering when the default methods ( *_isset, *_reset) of Class::MathodMaker gets created. Whether it gets created at the time of instantiation or only when it is invoked ($obj->field_reset). Would some one help me in debugging or inspecting the methods that get created from an MethodMaker object. Here is my sample code

package class; use Data::Dumper; use Class::MethodMaker get_set => [ qw/ field_1 field_2 field_3 field_4 field_5 +/] , new_with_init => 'new', new_hash_init => 'hash_init' ; sub init { my $self = shift ; $self->hash_init(@_) ; } my %values = map { 'field_'.$_ => $_ } (1 .. 5 ); my $class = class->new(\%values); print Dumper($class); 1;
In Dumper result I am just getting the fields. I want to know all the possible methods that can be called from $class( including the deafults *_reset, *_isset ...). Please help me with more inspection or debugging modules to inspect the $class object.
Thanks,
Siraj



Thanks for the help, it helped me a great, also I found another module Class::Inspector to inspect the methods in the object.

print Dumper(Class::Inspector->methods($class);

In reply to when is *_reset methods of Class::MethodMaker gets created by siraj

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.