in reply to Using caller to determine the namespace of an anonymous subroutine
Perl Hacks has a tip from Ovid that shows how to get around this. Add one line of code to Creator::create():
*{$caller."::".$field} = sub { local *__ANON__ = "${caller}::${field}"; my $self = shift; return $self->STORE( $field, @_ ) if @_; return $self->FETCH( $field ); };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Using caller to determine the namespace of an anonymous subroutine
by rrwo (Friar) on Feb 24, 2006 at 00:51 UTC |
In Section
Seekers of Perl Wisdom