annotate Lib/IMPL/base.pm @ 159:f8de52d3c112

IMPL::Test::Unit minor changes
author wizard
date Mon, 27 Dec 2010 01:37:44 +0300
parents e6447ad85cb4
children 6ce1f052b90a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
134
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
1 package IMPL::base;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
2 use strict;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
3
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
4 my %loaded;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
5
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
6 sub import {
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
7 shift;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
8
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
9 no strict 'refs';
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
10 my $class = caller;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
11
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
12 foreach my $baseClass (@_) {
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
13 unless ($loaded{$baseClass}) {
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
14 undef $!;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
15 undef $@;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
16 $loaded{$baseClass} = 1;
148
e6447ad85cb4 DOM objects now have a schema and schemaSource properties
wizard
parents: 134
diff changeset
17 eval "require $baseClass; 1;";
134
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
18
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
19 die $@ if $@ and not $!;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
20 }
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
21
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
22 #TODO debug warn if base class is empty;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
23
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
24 push @{"${class}::ISA"}, $baseClass;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
25 }
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
26 }
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
27
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
28 1;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
29
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
30 __END__
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
31
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
32 =pod
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
33
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
34 =head1 NAME
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
35
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
36 C<IMPL::base> быстрая версия директивы C<base>.
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
37
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
38 =cut