Convert/Spry.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 26 CC 1 SCAR 6.9
CC
1
Cov
0%
scan
2.0
output
2.0
BEGIN
2.0
CRAP 2.0
1 =head1 NAME
2  
3 Mail::Addressbook::Convert::Spry - from Spry Mail Addressbook
4  
5 =head1 SYNOPSIS
6  
7 use strict;
8  
9 use Mail::Addressbook::Convert::Spry;
10  
11 my $SPRY = new Mail::Addressbook::Convert::Spry();
12  
13 my $SpryInFile ="spry.als"; # name of the file containing the Spry data
14 # it is found in the Spry folder
15  
16 # Convert Spry to Standard Intermediate format
17  
18 # see documentation for details on format.
19  
20 my $raIntermediate = $SPRY->scan(\$SpryInFile);
21  
22 # This will also work
23  
24 #my @SpryInArray = @arrayContainingTheSpryData;
25  
26 #my $raIntermediate = $SPRY->scan(\@SpryInArray);
27  
28  
29  
30  
31 print join "", @$raIntermediate;
32  
33  
34  
35 =head1 REQUIRES
36  
37 Perl, version 5.001 or higher
38  
39 Carp
40  
41 =head1 DESCRIPTION
42  
43 This module is meant to be used as part of the Mail::Addressbook::Convert distribution.
44  
45 It can convert a Spry addressbook to a Standard Intermediate format(STF) and a STF to TSV
46 As part of the larger distribution, it will allow conversion between Spry and many other
47 formats.
48  
49 To use to convert between Spry and Eudora as an example, you would do the following
50  
51 use Mail::Addressbook::Convert::Spry;
52  
53 use Mail::Addressbook::Convert::Eudora;
54  
55 my $Spry = new Mail::Addressbook::Convert::Spry();
56  
57 my $Eudora = new Mail::Addressbook::Convert::Eudora();
58  
59 my $spryInFile ="sprySample.txt"; # name of the file containing the Spry data
60  
61 my $raIntermediate = $Spry->scan(\$spryInFile);
62  
63 my $raEudora = $Eudora->output($raIntermediate); # reference to an array containing a Eudora addressbook
64  
65  
66 =head1 DEFINITIONS
67
68 Standard Intermediate Format(STF) :
69  
70 The addressbook format that is used as an intermediate
71 between conversions. It is rfc822 compliant and can
72 be used directly as a Eudora addressbook. Do not use
73 a Eudora addressbook as an STF. Some versions of
74 Eudora use a format, that while RFC822 compliant, will
75 not work as an STF. Run the Eudora addressbook
76 through $Eudora->scan()
77
78 Spry addressbook:
79  
80 They are in the Spry folder with an ".als" extension
81  
82  
83 =head1 METHODS
84  
85 =head2 new
86  
87 no arguments needed.
88  
89 =head2 scan
90  
91 Input : a reference to an array containing a tsv file or a reference to a scalar containing
92 the file name with the tsv data.
93 Returns: a reference to a STF ( see above).
94  
95 =head2 output
96  
97 There is no output method. That is you cannot convert to a Spry format.
98  
99  
100 =head1 LIMITATIONS
101  
102 This only converts email address, aliases, and mailing lists. Phone numbers,
103 postal addresses and other such data are not converted.
104  
105  
106  
107 =head1 REFERENCES
108  
109  
110  
111
112  
113 =head1 HISTORY
114  
115 This code is derived from the code used on www.interguru.com/mailconv.htm . The site
116 has been up since 1996 ( but ldif was only included on 1997, when Netscape 3 started
117 using it.) The site gets about 8000 unique visitors a month, many of whom make addressbook
118 conversions. The code has been well tested.
119  
120 =head1 FUTURE DIRECTIONS
121  
122  
123  
124  
125 =head1 SEE ALSO
126  
127  
128  
129 =head1 BUGS
130  
131 =head1 CHANGES
132  
133 Original Version 2001-Sept-09
134
135 =head1 COPYRIGHT
136  
137 Copyright (c) 2001 Joe Davidson. All rights reserved.
138 This program is free software; you can redistribute it
139 and/or modify it under the terms of the Perl Artistic License
140 (see http://www.perl.com/perl/misc/Artistic.html). or the
141 GPL copyleft license ( http://www.gnu.org/copyleft/gpl.html)
142  
143  
144 =head1 AUTHOR
145  
146 Mail::Addressbook::Convert was written by Joe Davidson <jdavidson@interguru.com> in 2001.
147  
148 =cut
149  
150 #------------------------------------------------------------------------------
151  
152 use strict;
153  
154 use Mail::Addressbook::Convert::Genr;
155  
156  
157  
158  
159 package Mail::Addressbook::Convert::Tsv;
160  
161  
162 use 5.001;
163  
164 use vars qw(@ISA );
165 @ISA = qw { Mail::Addressbook::Convert::Genr };
166  
167 ############# Constructor ##########################################
168  
169 # new is inherited
170  
171
172 ######################################################################
173  
174 sub scan
175 {
176 my $Csv = shift;
177 my $inputParm=shift;
178 $Csv->setfileFormat("spry");
179 $Csv->SUPER::scan($inputParm);
180  
181  
182 }
183 # sub output is inherited from genr.
184  
185 sub output
186 {
187 confess "\nSpry.pm does not have an output method. \n You cannot convert to Spry";
188  
189  
190 }
191  
192 1;