in reply to Re^4: A different OO approach
in thread A different OO approach
seems extreme for a module. On the other hand, if your attributes are more complex it could easily become worthy of using a module.sub add { my ($self,$name,$value) = @_; return if $name !~/^\w+$/; my $pack = ref $self; no strict 'refs'; *{$pack.'::'.$name} = sub : lvalue { $Attrs{+shift}->{$name} }; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: A different OO approach
by adrianh (Chancellor) on Dec 15, 2002 at 23:08 UTC | |
by Aristotle (Chancellor) on Dec 16, 2002 at 00:45 UTC |