blob: 9b7a2c046f555280db8d2036d674302cb8439d5c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package c; # $Id: c.pm 210307 2004-12-13 15:56:00Z tvignaud $
use vars qw($AUTOLOAD);
use c::stuff;
use MDK::Common;
sub AUTOLOAD() {
$AUTOLOAD =~ /::(.*)/ or return;
my $fct = $1;
my @l = eval { &{$c::stuff::{$fct}} };
if (my $err = $@) {
$err =~ /Undefined subroutine &main::/ ?
die("cannot find function $AUTOLOAD\n" . backtrace()) :
die("$fct: " . $err);
}
wantarray() ? @l : $l[0];
}
1;
|