sub DebugPrint { my $msg = shift; my ($package,$filename,$line,$subroutine) = caller(1); print "Called from $subroutine(): $msg"; }