Text::SimpleVcard - a package to manage a single vCard
Version 0.05
simplevCard - This package provides an API to reading a single vCard. A vCard is an electronic business card. You will find that many applications (KDE Address book, Apple Address book, MS Outlook, Evolution, etc.) use and can export and import vCards.
This module offers only basic vcard features (folding, ...). Grouping, etc. is not yet supported. Further enhancements are always welcome.
SimpleVcard has a minimum of dependencies (actually only 'MIME::QuotedPrint'), it should work with every installation.
use Text::SimpleVcard; open FH, "< std.vcf"; # 'std.vcf' contains a single vcard-entry my $vCard = Text::SimpleVcard->new( join( '', <FH>)); $vCard->print(); print "FN=" . $vCard->getSimpleValue( 'FN') . "\n"; print "fullname=" . $vCard->getFullName() . "\n"; my %h = $vCard->getValuesAsHash( 'TEL', [qw( WORK HOME)]); print "phone-numbers are:\n"; foreach( keys %h) { print "Got number $_ ($h{$_})\n"; }
my $vCard = simpleVcard->new( $dat);
The method will create a simpleVcard object from vcard data (e.g. from a vCard-File (see example above)). Nested vCards will be ignored.
simpleVcard
$vCard->print(); $vCard->sprint();
The method will print a simpleVcard-object to stdout or, in case of sprint() to a string
sprint()
$vCard->getSimpleValue( $prop); $vCard->getSimpleValue( $prop, $n);
The method will fetch the first (or, if an index is provided, the n'th) value of the specified property. If the property or the index doesn't exist, it returns undef
$vCard->getSimpleValueOfType( $prop, [qw( WORK HOME)]]); $vCard->getSimpleValueOfType( $prop, [qw( WORK HOME)]], $n);
The method will fetch the first (or, if an index is provided, the n'th) value of the specified property of the desired type. If the property or the index doesn't exist, it returns undef
$vCard->getFullName();
The method will fetch the value of the property FN, and get rid off any backslashes found in that value
FN
$vCard->getValuesAsHash( 'TEL', [qw( WORK HOME)]]);
The method will return a hash returning the values of the provided property. The value will contain a CSV-list of the matching types. if no types are provided, it will return all types found.
Michael Tomuschat, <michael.tomuschat at t-online.de>
<michael.tomuschat at t-online.de>
Text::SimpleAdrbook - A module that can read several vCard-files
vCard
Please report any bugs or feature requests to bug-text-simplevcard at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Text-SimpleVcard. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-text-simplevcard at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Text::SimpleVcard
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Text-SimpleVcard
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Text-SimpleVcard
CPAN Ratings
http://cpanratings.perl.org/d/Text-SimpleVcard
Search CPAN
http://search.cpan.org/dist/Text-SimpleVcard
Copyright 2008-2009 Michael Tomuschat, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Text::SimpleVproperty, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::SimpleVproperty
CPAN shell
perl -MCPAN -e shell install Text::SimpleVproperty
For more information on module installation, please visit the detailed CPAN module installation guide.