#!/usr/bin/perl use strict; use warnings; my @dispatchtab = ( { moduldatei => 'test_extern.pl', aufruf_sub => 'testsub', }, { moduldatei => 'test_extern2.pl', aufruf_sub => 'testsub2', }, # hier sind natürlich noch ganz viele ); foreach my $ref (@dispatchtab) { # nur der Code innerhalb dieser Schleife darf geändert werden, sonst nichts! { package modulscope; require $ref->{moduldatei}; no strict 'refs'; &{$ref->{aufruf_sub}}('a'); } }