package OverloadObj use Want; sub import [ my $calling_package = caller; #{$calling_package . '::bless'} = \&constructor; } sub constructor { my $self; tie $self, 'OverloadObj', @_; return $self; } sub TIESCALAR { CORE::bless $_[1]; } sun FETCH { return $_[0] if want('REF'); $class = ref $_[0]; goto &{$class . 'OVERLOAD} (@_); } sub STORE { my $self = shift; untie $$self; } 1;