diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Test/Tester/Delegate.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Test/Tester/Delegate.pm | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/Test/Tester/Delegate.pm b/Master/tlpkg/tlperl/lib/Test/Tester/Delegate.pm new file mode 100644 index 00000000000..7ddb921cdfc --- /dev/null +++ b/Master/tlpkg/tlperl/lib/Test/Tester/Delegate.pm @@ -0,0 +1,32 @@ +use strict; +use warnings; + +package Test::Tester::Delegate; + +use vars '$AUTOLOAD'; + +sub new +{ + my $pkg = shift; + + my $obj = shift; + my $self = bless {}, $pkg; + + return $self; +} + +sub AUTOLOAD +{ + my ($sub) = $AUTOLOAD =~ /.*::(.*?)$/; + + return if $sub eq "DESTROY"; + + my $obj = $_[0]->{Object}; + + my $ref = $obj->can($sub); + shift(@_); + unshift(@_, $obj); + goto &$ref; +} + +1; |