in reply to Using the strict module in object oriented programming
This does not provide security, as someone can always use unlock_keys - but it could prevent you from entering the wrong fieldname by accident.
Personally I prefer to encapsulate such access control in accessors and mutators for the object, instead of encouraging the user to access the variables directly.
For example, $self->set_type('cat') or $self->set('type','cat')
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using the strict module in object oriented programming
by doom (Deacon) on Jul 25, 2006 at 18:51 UTC | |
by imp (Priest) on Jul 26, 2006 at 02:20 UTC | |
by mrguy123 (Hermit) on Jul 26, 2006 at 07:40 UTC |