/[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 373 - (show annotations)
Sun Jun 20 15:49:09 2004 UTC (15 years, 4 months ago) by dpavlin
File MIME type: text/plain
File size: 1280 byte(s)
a lot more logging, lookups are now working as expected (and documented)

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
13 use lib './lib';
14 use WebPAC;
15
16
17 my $webpac = new WebPAC(
18 code_page => 'ISO-8859-2',
19 limit_mfn => 500,
20 # debug => 1,
21 ) || die;
22
23 my $log = $webpac->_get_logger();
24
25 $|=1;
26
27 my $maxmfn = $webpac->open_isis(
28 filename => shift @ARGV || '/data/hidra/THS/THS',
29 lookup => [
30 { 'key' => 'd:v900', 'val' => 'v250^a' },
31 # { 'eval' => '"v901^a" eq "Podruèje"', 'key' => 'pa:v561^4:v562^4:v461^1', 'val' => 'v900' },
32 # { 'eval '=> '"v901^a" eq "Mikrotezaurus"', 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' },
33 # { 'eval' => '"v901^a" eq "Deskriptor"', 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' },
34 { 'key' => 'a:v561^4:v562^4:v461^1', 'val' => 'v900' },
35 ],
36 );
37
38 $log->info("rows: $maxmfn");
39
40 $webpac->open_import_xml(type => 'isis_hidra_ths');
41
42 while (my $rec = $webpac->fetch_rec) {
43
44 my @ds = $webpac->data_structure($rec);
45
46 if ($log->is_debug) {
47 $log->debug("rec = ",Dumper($rec));
48 $log->debug("ds = ",Dumper(\@ds));
49 }
50
51 print $webpac->output(
52 template => 'text.tt',
53 data => \@ds,
54 ) if (@ds);
55
56 }
57
58 if ($log->is_debug) {
59 $log->debug("lookup hash: ",Dumper($webpac->{'lookup'}));
60 $log->debug("data hash: ",Dumper($webpac->{'data'}));
61 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26