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

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

revision 741 by dpavlin, Sun Oct 8 00:38:04 2006 UTC revision 750 by dpavlin, Sun Oct 8 13:24:46 2006 UTC
# Line 39  WebPAC::Normalize - describe normalisato Line 39  WebPAC::Normalize - describe normalisato
39    
40  =head1 VERSION  =head1 VERSION
41    
42  Version 0.22  Version 0.23
43    
44  =cut  =cut
45    
46  our $VERSION = '0.22';  our $VERSION = '0.23';
47    
48  =head1 SYNOPSIS  =head1 SYNOPSIS
49    
# Line 880  syntaxtic sugar for Line 880  syntaxtic sugar for
880    @v = rec('200')    @v = rec('200')
881    @v = rec('200','a')    @v = rec('200','a')
882    
883    If rec() returns just single value, it will
884    return scalar, not array.
885    
886  =cut  =cut
887    
888  sub rec {  sub rec {
# Line 889  sub rec { Line 892  sub rec {
892          } elsif ($#_ == 1) {          } elsif ($#_ == 1) {
893                  @out = rec2(@_);                  @out = rec2(@_);
894          }          }
895          if (@out) {          if ($#out == 0 && ! wantarray) {
896                    return $out[0];
897            } elsif (@out) {
898                  return @out;                  return @out;
899          } else {          } else {
900                  return '';                  return '';
# Line 1040  sub lookup { Line 1045  sub lookup {
1045    
1046          my @mfns = sort keys %$mfns;          my @mfns = sort keys %$mfns;
1047    
1048          warn "# lookup loading $database/$input/$key mfn ", join(",",@mfns)," having ",dump(@having),"\n";          warn "# lookup loading $database/$input/$key mfn ", join(",",@mfns)," having ",dump(@having),"\n" if ($debug);
1049    
1050          my $old_rec = $rec;          my $old_rec = $rec;
1051          my @out;          my @out;
# Line 1065  sub lookup { Line 1070  sub lookup {
1070    
1071          $rec = $old_rec;          $rec = $old_rec;
1072    
1073          warn "## lookup returns = ", dump(@out), $/;          warn "## lookup returns = ", dump(@out), $/ if ($debug);
1074    
1075          if ($#out == 0) {          if ($#out == 0) {
1076                  return $out[0];                  return $out[0];

Legend:
Removed from v.741  
changed lines
  Added in v.750

  ViewVC Help
Powered by ViewVC 1.1.26