sub printcaller { my $caller = (caller(1))[3]; print "$caller\n"; } my $paket = 'testpaket'; eval qq{ sub ${paket}::function { printcaller(); } }; testpaket::function(); # Ausgabe: testpaket::function