/[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

Contents of /trunk2/all2all.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 #!/usr/bin/perl -w
2
3 =head1 NAME
4
5 all2all.pl - basic script for all WebPAC needs
6
7 =cut
8
9 use strict;
10 use Data::Dumper;
11 use Carp;
12 use Log::Log4perl qw(get_logger :levels);
13
14 use lib './lib';
15 use WebPAC;
16
17 Log::Log4perl->init('log.conf');
18 my $log = get_logger();
19
20 my $webpac = new WebPAC(
21 code_page => 'ISO-8859-2',
22 limit_mfn => 500,
23 # debug => 1,
24 ) || die;
25
26 $|=1;
27
28 my $maxmfn = $webpac->open_isis(
29 filename => shift @ARGV || '/data/hidra/THS/THS',
30 lookup => [
31 { 'key' => 'd:v900', 'val' => 'v250^a' },
32 # { '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 );
38
39 $log->info("rows: $maxmfn");
40
41 $webpac->open_import_xml(type => 'isis_hidra_ths');
42
43 while (my $rec = $webpac->fetch_rec) {
44
45 my @ds = $webpac->data_structure($rec);
46
47 if ($log->is_debug) {
48 $log->debug("rec = ",Dumper($rec));
49 $log->debug("ds = ",Dumper(\@ds));
50 }
51
52 print $webpac->output(
53 template => 'text.tt',
54 data => \@ds,
55 ) if (@ds);
56
57 }
58
59 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