diff options
-rw-r--r-- | perl-install/c.pm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/perl-install/c.pm b/perl-install/c.pm index 0683c0ef8..aa03b9b1e 100644 --- a/perl-install/c.pm +++ b/perl-install/c.pm @@ -3,10 +3,17 @@ package c; # $Id$ use vars qw($AUTOLOAD); use c::stuff; +use MDK::Common; sub AUTOLOAD { $AUTOLOAD =~ /::(.*)/; - goto &{$c::stuff::{$1}}; + my @l = eval { &{$c::stuff::{$1}} }; + if (my $err = $@) { + $err =~ /Undefined subroutine &main::/ ? + die("can't find function $AUTOLOAD\n" . backtrace()) : + die($err); + } + wantarray ? @l : $l[0]; } 1; |