#!/usr/bin/perl use strict; use warnings; my @dispatchtab = ( { moduldatei => 'test_extern.pl', aufruf_sub => \&testsub, aufruf_neu => \&modulscope::testsub, }, { moduldatei => 'test_extern2.pl', aufruf_sub => \&testsub, aufruf_neu => \&modulscope::testsub, }, # 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}; $ref->{aufruf_neu}->('a'); }