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

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

revision 461 by dpavlin, Fri May 12 14:54:25 2006 UTC revision 463 by dpavlin, Fri May 12 19:59:25 2006 UTC
# Line 4  use Exporter 'import'; Line 4  use Exporter 'import';
4          set_rec set_lookup          set_rec set_lookup
5          get_ds clean_ds          get_ds clean_ds
6          tag search display          tag search display
7          rec1 rec2 rec regex first lookup join_with          rec1 rec2 rec
8            regex prefix
9            first lookup join_with
10  /;  /;
11    
12  use warnings;  use warnings;
# Line 19  WebPAC::Normalize::Set - describe normal Line 21  WebPAC::Normalize::Set - describe normal
21    
22  =head1 VERSION  =head1 VERSION
23    
24  Version 0.02  Version 0.03
25    
26  =cut  =cut
27    
28  our $VERSION = '0.02';  our $VERSION = '0.03';
29    
30  =head1 SYNOPSIS  =head1 SYNOPSIS
31    
# Line 59  By default, output will go into I<search Line 61  By default, output will go into I<search
61  my $out;  my $out;
62    
63  sub tag {  sub tag {
64          my $name = shift or "tag needs name as first argument";          my $name = shift or die "tag needs name as first argument";
65          return unless (@_);          return unless (@_);
66          $out->{$name}->{tag} = $name;          $out->{$name}->{tag} = $name;
67          $out->{$name}->{search} = \@_;          $out->{$name}->{search} = \@_;
# Line 75  Define tag just for I<display> Line 77  Define tag just for I<display>
77  =cut  =cut
78    
79  sub display {  sub display {
80          my $name = shift or "display needs name as first argument";          my $name = shift or die "display needs name as first argument";
81          return unless (@_);          return unless (@_);
82          $out->{$name}->{tag} = $name;          $out->{$name}->{tag} = $name;
83          $out->{$name}->{display} = \@_;          $out->{$name}->{display} = \@_;
# Line 90  Prepare values just for I<search> Line 92  Prepare values just for I<search>
92  =cut  =cut
93    
94  sub search {  sub search {
95          my $name = shift or "search needs name as first argument";          my $name = shift or die "search needs name as first argument";
96          return unless (@_);          return unless (@_);
97          $out->{$name}->{tag} = $name;          $out->{$name}->{tag} = $name;
98          $out->{$name}->{search} = \@_;          $out->{$name}->{search} = \@_;
# Line 209  sub regex { Line 211  sub regex {
211          return @out;          return @out;
212  }  }
213    
214    =head2 prefix
215    
216    Prefix all values with a string
217    
218      @v = prefix( 'my_', @v );
219    
220    =cut
221    
222    sub prefix {
223            my $p = shift or die "prefix needs string as first argument";
224            return map { $p . $_ } @_;
225    }
226    
227  =head2 first  =head2 first
228    
229  Return first element  Return first element

Legend:
Removed from v.461  
changed lines
  Added in v.463

  ViewVC Help
Powered by ViewVC 1.1.26