--- trunk/lib/WebPAC/Common.pm 2005/07/16 12:37:18 4 +++ trunk/lib/WebPAC/Common.pm 2005/07/16 16:00:19 7 @@ -17,11 +17,19 @@ our $VERSION = '0.01'; -#my $LOOKUP_REGEX = '\[[^\[\]]+\]'; -#my $LOOKUP_REGEX_SAVE = '\[([^\[\]]+)\]'; -my $LOOKUP_REGEX = 'lookup{[^\{\}]+}'; -my $LOOKUP_REGEX_SAVE = 'lookup{([^\{\}]+)}'; +=head1 SYNOPSYS +This module defines common functions, and is used as base for other, more +specific modules. + + my $webpac = new WebPAC::Common( + filter => { + 'filter_name_1' => sub { + # filter code + return length($_); + }, ... + }, + } =head1 FUNCTIONS @@ -96,8 +104,7 @@ $log->debug("filter result: $format"); } # do we have lookups? - if ($format =~ /$LOOKUP_REGEX/o) { - $log->debug("format '$format' has lookup"); + if ($self->{'lookup'}) { return $self->lookup($format); } else { return $format; @@ -234,6 +241,9 @@ $webpac->_init_logger('/path/to/log.conf'); +If no path to configuration file is given, dummy empty configuration +will be create. + =cut sub _init_logger {