Text-SimpleVaddrbook
view release on metacpan or search on metacpan
DESCRIPTION
Text::SimplevAddrbook - This package provides an API for reading multiple
vCards from addressbooks. A vcard is an electronic business card. You will find
that many applications (KDE-Address book, Apple Address book, MS Outlook,
Evolution, etc.) can export and import vCards.
It depends on Text::SimpleVcard which provides functions for extracting infos
from a singel vcard.
INSTALLATION
To install this module, run the following commands:
perl Makefile.PL
make
make test
make install
lib/Text/SimpleVaddrbook.pm view on Meta::CPAN
package Text::SimpleVaddrbook;
use Text::SimpleVcard;
use warnings;
use strict;
=head1 NAME
Text::SimpleVaddrbook - a package to manage multiple vCard-files
=head1 VERSION
lib/Text/SimpleVaddrbook.pm view on Meta::CPAN
push( @{ $self->{ fn}}, $_);
}
bless( $self, $class);
}
=head2 next()
my $vCard = $aBook->next();
This method will read the next C<vCard>-entry in the list of C<vCard>-files.
It returns the entry in a C<vCard>-object (see also C<Text::SimpleVcard>). it will
return C<undef> when called after the last entry was returned.
=cut
sub next() {
my( $class) = @_;
my( $dat, $lin);
while( 1) {
# open a new file if necessary
lib/Text/SimpleVaddrbook.pm view on Meta::CPAN
last;
}
}
next if( eof( $fh)); # eof reached -> go to next file
$dat = $lin; # put start of vcard into buffer
while( $lin = <$fh>) {
$dat .= $lin;
$vCardCnt++ if( $lin =~ /^BEGIN:VCARD/);
$vCardCnt-- if( $lin =~ /^END:VCARD/);
return Text::SimpleVcard->new( $dat) if( $vCardCnt == 0);
}
}
}
=head2 rewind()
$aBook->rewind();
This method will rewind the filepointers, so that the next call of the method C<next()> will
return the first entry of the first C<vCard> provided. This method is useful to re-read the
( run in 0.693 second using v1.01-cache-2.11-cpan-a5abf4f5562 )