/[webpac2]/trunk/lib/WebPAC/Lookup.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/Lookup.pm

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

revision 251 by dpavlin, Thu Dec 15 14:12:00 2005 UTC revision 252 by dpavlin, Thu Dec 15 17:01:04 2005 UTC
# Line 83  sub new { Line 83  sub new {
83    
84          $log->logconfess("lookup config file isn't ARRAY but ", sub { Dumper( $self->{'lookup_def'} ) }) if ($self->{'lookup_def'} !~ /ARRAY/o);          $log->logconfess("lookup config file isn't ARRAY but ", sub { Dumper( $self->{'lookup_def'} ) }) if ($self->{'lookup_def'} !~ /ARRAY/o);
85    
86          $self->{'is_lookup_regex'} ||= 'lookup{\[[^\{\}]+\]}';          $self->{'is_lookup_regex'} ||= 'lookup{[^\{\}]+}';
87          $self->{'save_lookup_regex'} ||= 'lookup{([^\{\}]+)}';          $self->{'save_lookup_regex'} ||= 'lookup{([^\{\}]+)}';
88    
89    
# Line 162  sub lookup { Line 162  sub lookup {
162          if ($tmp =~ $self->{'LOOKUP_REGEX'}) {          if ($tmp =~ $self->{'LOOKUP_REGEX'}) {
163                  my @in = ( $tmp );                  my @in = ( $tmp );
164    
                 $log->debug("lookup for: ",$tmp);  
   
165                  my @out;                  my @out;
166                  while (my $f = shift @in) {                  while (my $f = shift @in) {
167                          if ($f =~ $self->{'LOOKUP_REGEX_SAVE'}) {                          if ($f =~ $self->{'LOOKUP_REGEX_SAVE'}) {
# Line 181  sub lookup { Line 179  sub lookup {
179                                  push @out, $f;                                  push @out, $f;
180                          }                          }
181                  }                  }
182                    $log->debug("lookup for: ",$tmp, " returned: ", join(", ",@out));
183    
184                  $log->logconfess("return is array and it's not expected!") unless wantarray;                  $log->logconfess("return is array and it's not expected!") unless wantarray;
185    
186                  return @out;                  return @out;
187          } else {          } else {
188                  return $tmp;                  return $tmp;

Legend:
Removed from v.251  
changed lines
  Added in v.252

  ViewVC Help
Powered by ViewVC 1.1.26