use strict;
use warnings;
my $obj = bless {};
my @mem = qw(hello world);
for (@mem) {
my $mem = "_do_$_";
next unless $obj->can ($mem);
$obj->$mem ();
}
sub _do_hello {print 'hello ';}
sub _do_world {print "world\n";}
sub _do_nothing {print 'nothing ';}
How could a mechanical parser decide what to keep and what to clean? How about when the contents of @mem depends on a preceding parse step and thus on user input?
It may be that tools such as UML::Class::Simple will help. Becoming familiar with a too-big codebase? and Analyzing large Perl code base. have good answers that may help too.
DWIM is Perl's answer to Gödel
|