how die in AUTOLOAD
From: Yuri Shtil (yshtil_at_cisco.com)
Date: 02/28/04
- Next message: Stephen Moon: "reading output file data as input data"
- Previous message: gnari: "Re: LWP User Agent/HTTP Request help needed!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 28 Feb 2004 13:22:24 -0800
Hi all
I wrote the following code to call functions in an another package and
process the return value.
I check if the computed routine exists in the target package and call
die if it does not. When I run this code there is no die message
displayed, the program exits silently.
Any thoughts?
no strict;
sub AUTOLOAD
{
my ($name, $oldsub);
my $sub = $oldsub = $AUTOLOAD;
$sub =~ s/.*::_(.+)$/package::$1/;
$name = $1;
if (! defined &$sub) {
die "cannot autoload $oldsub";
}
$AUTOLOAD = $sub;
my $ret = &$AUTOLOAD;
# Process return value
}
- Next message: Stephen Moon: "reading output file data as input data"
- Previous message: gnari: "Re: LWP User Agent/HTTP Request help needed!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|