sub new { my $proto = shift; # Get the Prototype my $class = ref ($proto) || $proto; # Make the Class Name my $parent= ref ($proto) && $proto; # Get the Parent Class (if Any) my $self = {}; # Create the HASH for the Object bless($self, $class); # Create the Object $self->{_PARENT}= $parent; $self->{_RESULT} = ""; # Result of the method call $self->{_STATUS} = 0; # Status Return (0 = OK) $self->{SERVER} = XXX->new(); return $self; # Return the Object Reference } sub allowed_function { my $self = shift; my $function = shift; if ($function eq "sane") { return(1) ; } else { return(0); } } sub AUTOLOAD { my $self = shift; my $thing = $AUTOLOAD; $thing =~ s/.*:://g; return if $AUTOLOAD =~ /DESTROY$/; if ($self->allowed_function($thing) { $self->{SERVER}->$AUTOLOAD(@_); } } #### my $X = XYZServer->new; my $sane; $sane = $X->sane; #### $sane = $X->insane;