| June 2001 | Making a Module |
use vars qw ($AUTOLOAD);
sub AUTOLOAD
{
my $name = $AUTOLOAD;
$name =~ s/^.*:://;
goto &Exporter::AUTOLOAD unless (exists $AUTOLOADABLE{$name});
my $self = shift;
if ($AUTOLOADABLE{$name} eq 'h') {
return %{($self->{$name} || undef)};
} elsif ($AUTOLOADABLE{$name} eq 's') {
return $self->{$name} || undef;
} else {
return undef;
}
}
|
|
| Copyright © 2001 R. Geoffrey Avery |