view Lib/IMPL/base.pm @ 151:e36ffd8c29db

Fixed major bug in conversion from a POST request to the DOM document (when instanceId == 0) minor fixes
author wizard
date Fri, 20 Aug 2010 16:33:37 +0400
parents e6447ad85cb4
children 6ce1f052b90a
line wrap: on
line source

package IMPL::base;
use strict;

my %loaded;

sub import {
	shift;
	
	no strict 'refs';
	my $class = caller;
	
	foreach my $baseClass (@_) {
		unless ($loaded{$baseClass}) {
			undef $!;
			undef $@;
			$loaded{$baseClass} = 1;
			eval "require $baseClass; 1;";
			
			die $@ if $@ and not $!;
		}
		
		#TODO debug warn if base class is empty;
		
		push @{"${class}::ISA"}, $baseClass;
	}
}

1;

__END__

=pod

=head1 NAME

C<IMPL::base> быстрая версия директивы C<base>.

=cut