/[webpac2]/trunk/lib/WebPAC/Common.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Common.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4 by dpavlin, Sat Jul 16 12:37:18 2005 UTC revision 7 by dpavlin, Sat Jul 16 16:00:19 2005 UTC
# Line 17  Version 0.01 Line 17  Version 0.01
17    
18  our $VERSION = '0.01';  our $VERSION = '0.01';
19    
20  #my $LOOKUP_REGEX = '\[[^\[\]]+\]';  =head1 SYNOPSYS
 #my $LOOKUP_REGEX_SAVE = '\[([^\[\]]+)\]';  
 my $LOOKUP_REGEX = 'lookup{[^\{\}]+}';  
 my $LOOKUP_REGEX_SAVE = 'lookup{([^\{\}]+)}';  
21    
22    This module defines common functions, and is used as base for other, more
23    specific modules.
24    
25     my $webpac = new WebPAC::Common(
26            filter => {
27                    'filter_name_1' => sub {
28                            # filter code
29                            return length($_);
30                    }, ...
31            },
32      }
33    
34  =head1 FUNCTIONS  =head1 FUNCTIONS
35    
# Line 96  sub fill_in { Line 104  sub fill_in {
104                          $log->debug("filter result: $format");                          $log->debug("filter result: $format");
105                  }                  }
106                  # do we have lookups?                  # do we have lookups?
107                  if ($format =~ /$LOOKUP_REGEX/o) {                  if ($self->{'lookup'}) {
                         $log->debug("format '$format' has lookup");  
108                          return $self->lookup($format);                          return $self->lookup($format);
109                  } else {                  } else {
110                          return $format;                          return $format;
# Line 234  This function will init C<Log::Log4perl> Line 241  This function will init C<Log::Log4perl>
241    
242    $webpac->_init_logger('/path/to/log.conf');    $webpac->_init_logger('/path/to/log.conf');
243    
244    If no path to configuration file is given, dummy empty configuration
245    will be create.
246    
247  =cut  =cut
248    
249  sub _init_logger {  sub _init_logger {

Legend:
Removed from v.4  
changed lines
  Added in v.7

  ViewVC Help
Powered by ViewVC 1.1.26