This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge maint-5.004 branch (5.004_04) with mainline.
[perl5.git] / lib / ISA.pm
1 package ISA;
2 use Carp;
3
4 sub import {
5     my $class = shift;
6     my ($package) = caller;
7     foreach my $base (@_) {
8         croak qq(No such class "$base") unless defined %{"$base\::"};
9         eval {
10             $base->ISA($package);
11         };
12         if ($@ && $@ !~ /^Can't locate object method/) {
13             $@ =~ s/ at .*? line \d+\n$//;
14             croak $@;
15         }
16     }
17     push(@{"$package\::ISA"}, @_);
18 }
19
20 1;