Text::SimpleVcard - a package to manage a single vCard


Text-SimpleVcard documentation  | view source Contained in the Text-SimpleVcard distribution.

Index


NAME

Top

Text::SimpleVcard - a package to manage a single vCard

VERSION

Top

Version 0.05

SYNOPSIS

Top

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";
   }

FUNCTIONS

Top

new()

   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.

print()

getSimpleValue()

   $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

getSimpleValueOfType()

   $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

getFullName()

   $vCard->getFullName();

The method will fetch the value of the property FN, and get rid off any backslashes found in that value

getValuesAsHash()

   $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.

AUTHOR

Top

Michael Tomuschat, <michael.tomuschat at t-online.de>

SEE ALSO

Top

Text::SimpleAdrbook - A module that can read several vCard-files

BUGS

Top

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.

SUPPORT

Top

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 & LICENSE

Top


Text-SimpleVcard documentation  | view source Contained in the Text-SimpleVcard distribution.