134
|
1 package IMPL::base;
|
|
2 use strict;
|
|
3
|
|
4 my %loaded;
|
|
5
|
|
6 sub import {
|
|
7 shift;
|
|
8
|
|
9 no strict 'refs';
|
|
10 my $class = caller;
|
|
11
|
|
12 foreach my $baseClass (@_) {
|
|
13 unless ($loaded{$baseClass}) {
|
|
14 undef $!;
|
|
15 undef $@;
|
|
16 $loaded{$baseClass} = 1;
|
|
17 eval "require $baseClass;";
|
|
18
|
|
19 die $@ if $@ and not $!;
|
|
20 }
|
|
21
|
|
22 #TODO debug warn if base class is empty;
|
|
23
|
|
24 push @{"${class}::ISA"}, $baseClass;
|
|
25 }
|
|
26 }
|
|
27
|
|
28 1;
|
|
29
|
|
30 __END__
|
|
31
|
|
32 =pod
|
|
33
|
|
34 =head1 NAME
|
|
35
|
|
36 C<IMPL::base> быстрая версия директивы C<base>.
|
|
37
|
|
38 =cut
|