From mvr707 at gmail.com Thu Jun 8 14:05:34 2017 From: mvr707 at gmail.com (Ramana V Mokkapati) Date: Thu, 8 Jun 2017 14:05:34 -0700 Subject: [Oc-pm] Find all methods of a Perl object Message-ID: Tony brought up this question last meeting. And I bumped into it today. Notice that both direct and inherited methods are listed.... [SNIP] #!/usr/bin/env perl use Modern::Perl; use Class::MOP; # Example 1 use Data::Table; my $dt = Data::Table->new([[11,12,13],[21,22,23],[31,32,33]], [qw/a b c/]); my $code_ref; # to find number of rows of an object for my $m (Class::MOP::Class->initialize('Data::Table')->get_all_methods) { print "name = ", $m->name, "\n"; print "package_name = ", $m->package_name, "\n"; print "fully_qualified_name = ", $m->fully_qualified_name, "\n"; print "body = ", $m->body, "\n"; print "===\n"; if ($m->name eq "nofRow") { $code_ref = $m->body; } } say "Number of rows = ", $code_ref->($dt); # Example 2 use WWW::Mechanize; my $agent = WWW::Mechanize->new(); for my $m (Class::MOP::Class->initialize('WWW::Mechanize')->get_all_methods) { print "name = ", $m->name, "\n"; print "package_name = ", $m->package_name, "\n"; print "fully_qualified_name = ", $m->fully_qualified_name, "\n"; print "body = ", $m->body, "\n"; print "===\n"; } [/SNIP] Reference: http://www.perlmonks.org/?node_id=741707 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony at metracom.com Fri Jun 16 19:44:56 2017 From: tony at metracom.com (Tony) Date: Fri, 16 Jun 2017 19:44:56 -0700 Subject: [Oc-pm] OC Perl meeting June 26th @ 7pm Message-ID: <281d1f00-9735-7ce1-29dd-a1d499252efa@metracom.com> OC Mongers, the June meeting is scheduled for Monday the 26th @ 7pm. We could use a volunteer speaker. See you at the meeting. http://oc.pm.org Tony From tony at metracom.com Sun Jun 25 17:24:34 2017 From: tony at metracom.com (Tony) Date: Sun, 25 Jun 2017 17:24:34 -0700 Subject: [Oc-pm] OC Perl meeting June 26th @ 7pm Message-ID: <6bc732eb-108b-1017-21b3-e5663974b2bc@metracom.com> OC Perl Mongers, see you all at the meeting on Monday evening the 26th at 7pm. We still have a open slot for anyone that would like to present. Let me know so that I post the details on the website. http://oc.pm.org Tony