Subj : Re: anyone know of a language where nonexistent functions return To : comp.programming From : Jonathan Bartlett Date : Fri Jul 22 2005 03:16 pm > So i'm intrigued now - what do folks use the feature for? Another application I thought of is as a wrapper to another class. For example, if I wanted to trace all of the calls made on an object, I could create a tracer class: package Tracer; sub new { my ($class, $traced_obj) = @_; my $self = { TRACED_OBJ => $traced_obj }; bless $self, $class; return $self; } sub AUTOLOAD { my $name = our $AUTOLOAD; *$AUTOLOAD = sub { my $self = shift; print STDERR "Calling $name\n"; $self->$name(@_); } goto &*AUTOLOAD; } Then I could use it like this: use Tracer; my $obj = new Tracer(new SomeOtherClass); $obj->whatever(); /* gives a trace and then calls "whatever" on the original object -- Completely API compatible with the original object */ Also you could create sort of "dynamic subclasses" which allow you to subclass a wide variety of objects (I used to be able to think of situations where this would be useful, but not at the moment). Jon ---- Learn to program using Linux assembly language http://www.cafeshops.com/bartlettpublish.8640017 .