File: simple-calls.t

package info (click to toggle)
libdata-showtable-perl 3.3-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,068 kB
  • ctags: 338
  • sloc: perl: 2,026; sh: 62; makefile: 36
file content (24 lines) | stat: -rw-r--r-- 592 bytes parent folder | download | duplicates (68)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl5

($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',
	);

$showSub = $types{$type} or 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";