comparison Lib/IMPL/declare.pm @ 211:2b9b55cfb79b

Completed IMPL::Web::AutoLocator, added tests
author cin
date Tue, 05 Jun 2012 07:45:21 +0400
parents a8db61d0ed33
children 431db7034a88
comparison
equal deleted inserted replaced
210:6adaeb86945d 211:2b9b55cfb79b
29 29
30 my %ctor; 30 my %ctor;
31 my @isa; 31 my @isa;
32 32
33 if (ref $base eq 'ARRAY') { 33 if (ref $base eq 'ARRAY') {
34 carp("will be changed in next version"); 34 carp "Odd elements number in require" unless scalar(@$base)%2 == 0;
35 @isa = map _require($_), @$base if @$base; 35 while ( my ($class,$mapper) = splice @$base, 0, 2 ) {
36 $class = $aliases->{$class} || _require($class);
37
38 push @isa,$class;
39 $ctor{$class} = $mapper;
40 }
36 } elsif (ref $base eq 'HASH' ) { 41 } elsif (ref $base eq 'HASH' ) {
37 while ( my ($class,$mapper) = each %$base ) { 42 while ( my ($class,$mapper) = each %$base ) {
38 $class = $aliases->{$class} || _require($class); 43 $class = $aliases->{$class} || _require($class);
39 44
40 push @isa,$class; 45 push @isa,$class;