14 |
|
|
15 |
=head1 VERSION |
=head1 VERSION |
16 |
|
|
17 |
Version 0.12 |
Version 0.13 |
18 |
|
|
19 |
=cut |
=cut |
20 |
|
|
21 |
our $VERSION = '0.12'; |
our $VERSION = '0.13'; |
22 |
|
|
23 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
24 |
|
|
180 |
|
|
181 |
my $input = $args->{input} || ''; |
my $input = $args->{input} || ''; |
182 |
|
|
183 |
my $cache_file = "$cache_path/$database/$input/$id"; |
my $cache_file = "$cache_path/ds/$database/$input/$id"; |
184 |
$cache_file =~ s#//#/#go; |
$cache_file =~ s#//#/#go; |
185 |
|
|
186 |
$log->debug("using cache_file $cache_file"); |
$log->debug("using cache_file $cache_file"); |
215 |
ds => $ds, |
ds => $ds, |
216 |
); |
); |
217 |
|
|
218 |
B<Totally broken, but fast.> |
C<database> and C<input> are optional. |
|
|
|
|
Depends on filename generated by C<load_ds>. |
|
219 |
|
|
220 |
=cut |
=cut |
221 |
|
|
240 |
|
|
241 |
my $input = $args->{input} || ''; |
my $input = $args->{input} || ''; |
242 |
|
|
243 |
my $cache_file = $self->{path} . "/$database/$input/"; |
my $cache_file = $self->{path} . "/ds/$database/$input/"; |
244 |
$cache_file =~ s#//#/#go; |
$cache_file =~ s#//#/#go; |
245 |
|
|
246 |
mkpath($cache_file) unless (-d $cache_file); |
mkpath($cache_file) unless (-d $cache_file); |
258 |
|
|
259 |
=head2 load_lookup |
=head2 load_lookup |
260 |
|
|
261 |
|
Loads lookup hash from file |
262 |
|
|
263 |
$data = $db->load_lookup( |
$data = $db->load_lookup( |
264 |
database => $database, |
database => $database, |
265 |
input => $input, |
input => $input, |
266 |
key => $key, |
key => $key, |
267 |
); |
); |
268 |
|
|
269 |
|
C<database> is optional. |
270 |
|
|
271 |
=cut |
=cut |
272 |
|
|
273 |
sub load_lookup { |
sub load_lookup { |
300 |
|
|
301 |
=head2 save_lookup |
=head2 save_lookup |
302 |
|
|
303 |
|
Save lookup data to file. |
304 |
|
|
305 |
$db->save_lookup( |
$db->save_lookup( |
306 |
database => $database, |
database => $database, |
307 |
input => $input, |
input => $input, |
309 |
data => $lookup, |
data => $lookup, |
310 |
); |
); |
311 |
|
|
312 |
|
C<database> is optional. |
313 |
|
|
314 |
=cut |
=cut |
315 |
|
|
316 |
sub save_lookup { |
sub save_lookup { |
347 |
|
|
348 |
=head1 COPYRIGHT & LICENSE |
=head1 COPYRIGHT & LICENSE |
349 |
|
|
350 |
Copyright 2005 Dobrica Pavlinusic, All Rights Reserved. |
Copyright 2005-2006 Dobrica Pavlinusic, All Rights Reserved. |
351 |
|
|
352 |
This program is free software; you can redistribute it and/or modify it |
This program is free software; you can redistribute it and/or modify it |
353 |
under the same terms as Perl itself. |
under the same terms as Perl itself. |