#!/usr/bin/perl use strict; use warnings; { sub test { my @info = caller(0); if( $info[0] ne __PACKAGE__ ) { print "(test) nicht erlaubt: Aufruf aus Package $info[0]\n"; } else{ print "(test) erlaubt\n"; } } }