1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#!/usr/bin/env perl
($DIR,$PROG) = $0 =~ m=^(.*/)?([^/]+)$=;
$DIR =~ s=/$== || chop($DIR = `pwd`);
($type,$what) = $PROG =~ /^(\w+)-(\w+)\./;
%types = ( list => 'ShowListTable',
html => 'ShowHTMLTable',
box => 'ShowBoxTable',
simple => 'ShowSimpleTable',
table => 'ShowTable',
);
if (defined $types{$type}) {
$showSub = $types{$type};
} else {
die "I don't know about \"$type\" types!\n";
}
$showSub = \&$showSub;
$what = "t/$what" if -d "t" && !-r "$what.pl";
-r "$what.pl" or die "I don't know how to do \"$what\"!\n";
unshift(@INC,'../blib/lib') if -d '../blib/lib';
unshift(@INC,'t') if -d 't';
do "$what.pl";
|