sub load_api_modules { my $self = shift; my $file = shift; local $_ = $file;#will work with $_ and keep $file return unless s/\.pm$//; require $file; my @sup = split m#/#; # s#/#::#g; unneccessary $self->{ $sup[1].$sup[2] } = $sup[@sup-1]->new(); $self->logObj->log( location => "Initialisation", message => "loaded: $file" ); }