annotate Lib/IMPL/base.pm @ 163:6ce1f052b90a

temp commit
author wizard
date Tue, 15 Mar 2011 02:32:42 +0300
parents e6447ad85cb4
children
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;
163
6ce1f052b90a temp commit
wizard
parents: 148
diff changeset
3 use IMPL::_core::version;
134
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
4
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
5 my %loaded;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
6
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
7 sub import {
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
8 shift;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
9
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
10 no strict 'refs';
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
11 my $class = caller;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
12
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
13 foreach my $baseClass (@_) {
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
14 unless ($loaded{$baseClass}) {
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
15 undef $!;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
16 undef $@;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
17 $loaded{$baseClass} = 1;
148
e6447ad85cb4 DOM objects now have a schema and schemaSource properties
wizard
parents: 134
diff changeset
18 eval "require $baseClass; 1;";
134
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
19
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
20 die $@ if $@ and not $!;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
21 }
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
22
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
23 #TODO debug warn if base class is empty;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
24
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
25 push @{"${class}::ISA"}, $baseClass;
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
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
29 1;
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
30
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
31 __END__
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
32
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
33 =pod
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
34
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
35 =head1 NAME
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
36
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
37 C<IMPL::base> быстрая версия директивы C<base>.
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
38
44977efed303 Significant performance optimizations
wizard
parents:
diff changeset
39 =cut