/[webpac]/trunk2/all2all.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk2/all2all.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 372 - (hide annotations)
Sat Jun 19 18:16:20 2004 UTC (15 years, 4 months ago) by dpavlin
File MIME type: text/plain
File size: 1344 byte(s)
Log4perl implementation

1 dpavlin 1 #!/usr/bin/perl -w
2    
3 dpavlin 348 =head1 NAME
4    
5 dpavlin 354 all2all.pl - basic script for all WebPAC needs
6 dpavlin 348
7     =cut
8    
9 dpavlin 1 use strict;
10     use Data::Dumper;
11 dpavlin 352 use Carp;
12 dpavlin 372 use Log::Log4perl qw(get_logger :levels);
13 dpavlin 1
14 dpavlin 352 use lib './lib';
15 dpavlin 354 use WebPAC;
16 dpavlin 348
17 dpavlin 372 Log::Log4perl->init('log.conf');
18     my $log = get_logger();
19    
20 dpavlin 354 my $webpac = new WebPAC(
21 dpavlin 352 code_page => 'ISO-8859-2',
22 dpavlin 370 limit_mfn => 500,
23 dpavlin 372 # debug => 1,
24 dpavlin 352 ) || die;
25    
26 dpavlin 10 $|=1;
27 dpavlin 9
28 dpavlin 352 my $maxmfn = $webpac->open_isis(
29 dpavlin 357 filename => shift @ARGV || '/data/hidra/THS/THS',
30 dpavlin 352 lookup => [
31 dpavlin 348 { 'key' => 'd:v900', 'val' => 'v250^a' },
32 dpavlin 352 # { 'eval' => '"v901^a" eq "Podruèje"', 'key' => 'pa:v561^4:v562^4:v461^1', 'val' => 'v900' },
33     # { 'eval '=> '"v901^a" eq "Mikrotezaurus"', 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' },
34     # { 'eval' => '"v901^a" eq "Deskriptor"', 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' },
35     { 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' },
36     ],
37 dpavlin 54 );
38 dpavlin 3
39 dpavlin 372 $log->info("rows: $maxmfn");
40 dpavlin 170
41 dpavlin 363 $webpac->open_import_xml(type => 'isis_hidra_ths');
42    
43 dpavlin 362 while (my $rec = $webpac->fetch_rec) {
44 dpavlin 358
45 dpavlin 370 my @ds = $webpac->data_structure($rec);
46 dpavlin 366
47 dpavlin 372 if ($log->is_debug) {
48     $log->debug("rec = ",Dumper($rec));
49     $log->debug("ds = ",Dumper(\@ds));
50     }
51    
52 dpavlin 370 print $webpac->output(
53     template => 'text.tt',
54     data => \@ds,
55     ) if (@ds);
56 dpavlin 366
57 dpavlin 3 }
58    
59 dpavlin 372 if ($log->is_debug) {
60     $log->debug("lookup hash: ",Dumper($webpac->{'lookup'}));
61     $log->debug("data hash: ",Dumper($webpac->{'data'}));
62     }

Properties

Name Value
cvs2svn:cvs-rev 1.64
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26