in reply to Old Code reference wants new life as Object.

It sounds to me like you're saying you want to be able to call $obj->status_form without defining it, and have it execute the code refs stored in the dispatch table. If so, then I think ikegami is mistaken; instead, you could use AUTOLOAD for this purpose:

{ package Foo; our $AUTOLOAD; use Carp; sub AUTOLOAD { my $self = shift; my($meth) = $AUTOLOAD =~ /.*::(.*)/; return $dispatch{$meth}->($self) if ref $dispatch{$meth}; Carp::cluck( "unknown $meth\n" ); } sub DESTROY { } # to keep this one from calling AUTOLOAD }
We're building the house of the future together.