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; |
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 |
|
|
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} = \@_; |
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} = \@_; |
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} = \@_; |
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 |