in reply to Re: When to use prototype inheritence?
in thread When to use prototype inheritence?

It depends on the system, but I think you could.
Admittedly not with local(*F::Q::name).

You could probably just do:

my $object = $proto->new(); $object->set(some=>'stuff'); { my $test_object = $object; $test_object->{method} = sub { print "got:".$_[0]->{_proto_}->method() }; $test_object->method(); }
This would depend on how the classless/prototype system works. (I don't know one well enough to give a full example)

Replies are listed 'Best First'.
Re: Re: Re: When to use prototype inheritence?
by simonm (Vicar) on Sep 08, 2003 at 16:13 UTC
    I believe that with Class::Classless, you can locally override the specific hash value you're interested in:
    local $test_object->{method} = sub { print "got:".$_[0]->{_proto_}->method() };