package base;
sub import{my$class=shift;
my$fields_base;
foreach my $base(@_){unless(defined%{"$base\::"}){eval"require $base";
die if$@&&$@!~/^Can't locate .*? at \(eval /;
unless(defined%{"$base\::"}){require Carp;
Carp::croak("Base class package \"$base\" is empty.\n","\t(Perhaps you need to 'use' the module ","which defines that package first.)");}}my$fglob;
if($fglob=${"$base\::"}{"FIELDS"}and*$fglob{HASH}){if($fields_base){require Carp;
Carp::croak("Can't multiply inherit %FIELDS");}else{$fields_base=$base;}}}my$pkg=caller(0);
push@{"$pkg\::ISA"},@_;
if($fields_base){require fields;
fields::inherit($pkg,$fields_base);}}1;
