use warnings;
use strict;
-use WebPAC::Common;
-
use base qw/WebPAC::Common WebPAC::Normalize/;
use File::Slurp;
use Data::Dumper;
'val' => 'v900' },
];
+Just for a reference, lookup data is internally stored in
+C<< $self->{'_lookup_data'} >>.
=head1 FUNCTIONS
my $key = $self->fill_in($rec,$i->{'key'}) || next;
my @val = $self->fill_in($rec,$i->{'val'}) || next;
$log->debug("stored $key = ",sub { join(" | ",@val) });
- push @{$self->{'lookup'}->{$key}}, @val;
+ push @{$self->{'_lookup_data'}->{$key}}, @val;
}
} else {
my $key = $self->fill_in($rec,$i->{'key'}) || next;
my @val = $self->fill_in($rec,$i->{'val'}) || next;
$log->debug("stored $key = ",sub { join(" | ",@val) });
- push @{$self->{'lookup'}->{$key}}, @val;
+ push @{$self->{'_lookup_data'}->{$key}}, @val;
}
}
while (my $f = shift @in) {
if ($f =~ $self->{'LOOKUP_REGEX_SAVE'}) {
my $k = $1;
- if ($self->{'lookup'}->{$k}) {
- foreach my $nv (@{$self->{'lookup'}->{$k}}) {
+ if ($self->{'_lookup_data'}->{$k}) {
+ foreach my $nv (@{$self->{'_lookup_data'}->{$k}}) {
my $tmp2 = $f;
$tmp2 =~ s/lookup{$k}/$nv/g;
push @in, $tmp2;
ok($lookup->add( $rec ), "add");
-ok($lookup->{'lookup'}, "have lookup hash");
+ok($lookup->{'_lookup_data'}, "have lookup hash");
my $lookup_res = {
'800:foo' => [ 'bar' ],
'900:bar' => [ 'FOO', 'foo' ]
};
-is_deeply($lookup_res, $lookup->{'lookup'}, "lookup data");
+is_deeply($lookup_res, $lookup->{'_lookup_data'}, "lookup data");
foreach my $k (keys %{ $lookup_res }) {
ok(my @l = $lookup->lookup("lookup{$k}"), "lookup{$k}");