NAME

Text::vCard::Precisely::Multiple - some add-on for Text::vCard::Precisely

SYNOPSIS

my $vcm = Text::vCard::Precisely::Multiple->new(); # default is 3.0

my $path = path( 'some', 'dir', 'example.vcf' );
$vcm->load_file($path);

or

my $arrayref = [
   {
       N   => [ 'Gump', 'Forrest', '', 'Mr.', '' ],
       FN  => 'Forrest Gump',
       ORG => 'Bubba Gump Shrimp Co.',
       TITLE => 'Shrimp Man',
       TEL => [
           { types => ['WORK','VOICE'], content => '(111) 555-1212' },
       ],
       ADR =>[{
           types       => ['work'],
           pref        => 1,
           extended    => 100,
           street      => 'Waters Edge',
           city        => 'Baytown',
           region      => 'LA',
           post_code   => '30314',
           country     => 'United States of America'
       }],
       EMAIL => 'forrestgump@example.com',
       REV => '20080424T195243Z',
   },{
       N   => [ 'One', 'Other', '', '', '' ],
       FN  => 'Other One',
       TEL => [
           { types => ['HOME','VOICE'], content => '(404) 555-1212', preferred => 1 },
       ],
       ADR =>[{
           types       => ['home'],
           extended    => 42,
           street      => 'Plantation St.',
           city        => 'Baytown',
           region      => 'LA',
           post_code   => '30314',
           country     => 'United States of America'
       }],
       EMAIL => 'other.one@example.com',
       REV => '20080424T195243Z',
   },
];

$vcm->load_arrayref($arrayref);

and

$vcm->as_string();

or

$vcm->as_file('output.vcf');

DESCRIPTION

If you have a file that contains multiple vCards, This module may be useful.

Constructors

load_arrayref($ArrayRef)

Accepts an ArrayRef that looks like below:

my $arrayref = [
   {
       N   => [ 'Gump', 'Forrest', '', 'Mr.', '' ],
       FN  => 'Forrest Gump',
       ORG => 'Bubba Gump Shrimp Co.',
       TITLE => 'Shrimp Man',
       TEL => [
           { types => ['WORK','VOICE'], content => '(111) 555-1212' },
       ],
       ADR =>[{
           types       => ['work'],
           pref        => 1,
           extended    => 100,
           street      => 'Waters Edge',
           city        => 'Baytown',
           region      => 'LA',
           post_code   => '30314',
           country     => 'United States of America'
       }],
       EMAIL => 'forrestgump@example.com',
       REV => '20080424T195243Z',
   },{...}
];

load_file($file_name)

Accepts a file name

METHODS

as_string()

Returns the vCards as a single string that is serialized.

as_file($filename)

Write vCards formated text into a single file to $filename. Dies if not successful

SIMPLE GETTERS/SETTERS

These methods accept and return strings

version()

returns Version number of the vcard. Defaults to '3.0' and this method is READONLY

for under perl-5.12.5

This module uses Text::vCard::Precisely and it require you to use 5.12.5 and later

SEE ALSO

AUTHOR

Yuki Yoshida(worthmine)

LICENSE

This is free software; you can redistribute it and/or modify it under the same terms as Perl.