line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use namespace::clean; |
5
|
1
|
|
|
1
|
|
90951
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
13329
|
|
|
1
|
|
|
|
|
6
|
|
6
|
1
|
|
|
1
|
|
1164
|
use Moo; |
|
1
|
|
|
|
|
153038
|
|
|
1
|
|
|
|
|
6
|
|
7
|
1
|
|
|
1
|
|
246
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
8
|
|
|
|
|
|
|
with 'Catmandu::Exporter'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $TAGS = [qw(TY A1 A2 A3 A4 AB AD AN AU AV BT C1 C2 C3 C4 C5 C6 C7 C8 CA CN |
11
|
|
|
|
|
|
|
CP CT CY DA DB DO DP ED EP ET ID IS J1 J2 JA JF JO KW L1 L2 L3 L4 |
12
|
|
|
|
|
|
|
LA LB LK M1 M2 M3 N1 N2 NV OP PB PP PY RI RN RP SE SN SP ST T1 T2 |
13
|
|
|
|
|
|
|
T3 TA TI TT U1 U2 U3 U4 U5 UR VL VO Y1 Y2)]; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $SMALL_TAG = qr/A2|AU|ED|EP|KW|PB|SP/; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my ($self, $data) = @_; |
18
|
|
|
|
|
|
|
my $fh = $self->fh; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
for my $tag (@$TAGS) { |
21
|
|
|
|
|
|
|
if (my $vals = $data->{$tag}) { |
22
|
|
|
|
|
|
|
$vals = [$vals] unless ref $vals; |
23
|
|
|
|
|
|
|
for my $val (@$vals) { |
24
|
|
|
|
|
|
|
$val = substr($val, 255) if length($val) > 255 && $tag =~ $SMALL_TAG; |
25
|
|
|
|
|
|
|
print $fh "$tag - $val\r\n"; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
print $fh "ER - \r\n"; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=pod |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 NAME |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Catmandu::Exporter::RIS - a RIS exporter |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SYNOPSIS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
use Catmandu::Exporter::RIS; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my $exporter = Catmandu::Exporter::RIS->new(fix => 'myfix.txt'); |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
$exporter->add_many($arrayref); |
49
|
|
|
|
|
|
|
$exporter->add_many($iterator); |
50
|
|
|
|
|
|
|
$exporter->add_many(sub { }); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
$exporter->add($hashref); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
$exporter->add({ |
55
|
|
|
|
|
|
|
TI => 'the Zen of CSS design', |
56
|
|
|
|
|
|
|
AU => ['Dave Shea','Molley E. Holzschlag'], |
57
|
|
|
|
|
|
|
IS => '0-321-30347-4' |
58
|
|
|
|
|
|
|
}); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
printf "exported %d objects\n" , $exporter->count; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 DESCRIPTION |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
The RIS exporter requires as input a Perl hash (or a fix) containing RIS |
65
|
|
|
|
|
|
|
fields and values as a string or array reference. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 SUPPORTED FIELDS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
TY ID T1 TI CT T2 BT T3 A1 AU A2 ED A3 Y1 PY Y2 N1 AB N2 KW RP |
70
|
|
|
|
|
|
|
JF JO JA J1 J2 VL IS CP SP EP CY PB SN AD AV M1 M2 M3 U1 U2 U3 U4 U5 |
71
|
|
|
|
|
|
|
UR L1 L2 L3 L4 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 SEE ALSO |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
L<Catmandu::Exporter> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |