summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-08-29 23:00:13 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-08-29 23:00:13 +0000
commit7f7391e2b44f61ce679d62c0a002453fb38b7684 (patch)
treec69da7caa7f9fa136485fb8f280df955c8803a64 /perl-install
parent1eb4032835f21848b14ca0eec83c203e7b8b46dd (diff)
downloaddrakx-backup-do-not-use-7f7391e2b44f61ce679d62c0a002453fb38b7684.tar
drakx-backup-do-not-use-7f7391e2b44f61ce679d62c0a002453fb38b7684.tar.gz
drakx-backup-do-not-use-7f7391e2b44f61ce679d62c0a002453fb38b7684.tar.bz2
drakx-backup-do-not-use-7f7391e2b44f61ce679d62c0a002453fb38b7684.tar.xz
drakx-backup-do-not-use-7f7391e2b44f61ce679d62c0a002453fb38b7684.zip
better error message when function c::foo() is missing
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/c.pm9
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;