You might also consider making the configuration an object member instead of a class member. Then you could have multiple, differently configured Form::Validator objects in existence at the same time. Here's how it would work:
package Form::Validator; sub new { ... $self->{allowed_tags} = []; # initially empty } sub SetConfig { my $self = shift; $self->{allowed_tags] = [ @_ ]; } package WebSite1::FormValidator; my $fv = new Form::Validator(); $fv->SetConfig(qw(a input ...)); ... package WebSite2::FormValidator; my $fv = new Form::Validator(); $fv->SetConfig(qw(...));
You could also make the configuration a constructor parameter.
In reply to Re: Where to store class configuration settings in a module used by multiple applications
by pc88mxer
in thread Where to store class configuration settings in a module used by multiple applications
by clinton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |