#!/usr/bin/perl use strict; use warnings; my @dispatchtab = ( { moduldatei => 'test_extern.pl', aufruf_neu => 'testsub', unit => 'unit1', }, { moduldatei => 'test_extern2.pl', aufruf_neu => 'testsub', unit => 'unit2', }, # hier sind natürlich noch ganz viele ); for my $ref ( @dispatchtab ) { eval <<"EVAL_CODE"; package $ref->{unit}; require "$ref->{moduldatei}"; $ref->{'aufruf_neu'}('a'); EVAL_CODE warn "ACHTUNG: '$@'\n" if $@; }