Text::vCard::Precisely::Multiple - some add-on for Text::vCard::Precisely
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');
If you have a file that contains multiple vCards, This module may be useful.
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', },{...} ];
Accepts a file name
Returns the vCards as a single string that is serialized.
Write vCards formated text into a single file to $filename. Dies if not successful
These methods accept and return strings
returns Version number of the vcard. Defaults to '3.0' and this method is READONLY
This module uses Text::vCard::Precisely and it require you to use 5.12.5 and later
RFC 2426
RFC 2425
RFC 6350
Text::vFile::asData
Yuki Yoshida(worthmine)
This is free software; you can redistribute it and/or modify it under the same terms as Perl.
To install Text::vCard::Precisely, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::vCard::Precisely
CPAN shell
perl -MCPAN -e shell install Text::vCard::Precisely
For more information on module installation, please visit the detailed CPAN module installation guide.