月曜日, 2月 26, 2007

sample "Class::Inspector" perl

#!/usr/local/bin/perl

use strict;use Class::Inspector;
package Test;
sub test_01 { print "test_01\n";}
sub test_02 { print "test_02\n";}

for my $m (sort grep /^test_/, @{Class::Inspector->methods('Test')}) {
Test->$m();
}

-result-

test_01
test_02

ラベル: