Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Perl package to edit and create vCard(s) (RFC 2426)

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 t
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Changes
Octocat-spinner-32 MANIFEST.SKIP
Octocat-spinner-32 README
Octocat-spinner-32 TODO Mass perltidy + whitespace cleanup (no code change) September 10, 2012
Octocat-spinner-32 dist.ini Version 3.02 February 14, 2014
README
vCard(3)              User Contributed Perl Documentation             vCard(3)



NNAAMMEE
       vCard - read, write, and edit a single vCard

SSYYNNOOPPSSIISS
           use vCard;

           # create the object
           my $vcard = vCard->new;

           # these methods load vCard data
           # (see method documentation for details)
           $vcard->load_file($filename);
           $vcard->load_string($string);
           $vcard->load_hashref($hashref);

           # simple getters/setters
           $vcard->full_name('Bruce Banner, PhD');
           $vcard->title('Research Scientist');
           $vcard->photo('http://example.com/bbanner.gif');

           # complex getters/setters
           $vcard->phones({
               { type => ['work', 'text'], number => '651-290-1234', preferred => 1 },
               { type => ['home'],         number => '651-290-1111' }
           });
           $vcard->email_addresses({
               { type => ['work'], address => 'bbanner@ssh.secret.army.mil' },
               { type => ['home'], address => 'bbanner@timewarner.com'      },
           });

           # these methods output data in vCard format
           my $file   = $vcard->as_file($filename); # writes to $filename
           my $string = $vcard->as_string;          # returns a string

DDEESSCCRRIIPPTTIIOONN
       A vCard is a digital business card.  vCard and vCard::AddressBook
       provide an API for parsing, editing, and creating vCards.

       This module is built on top of Text::vCard.  It provides a more
       intuitive user interface.

       To handle an address book with several vCard entries in it, start with
       vCard::AddressBook and then come back to this module.

       Note that the vCard RFC requires _v_e_r_s_i_o_n_(_) and _f_u_l_l___n_a_m_e_(_).  This
       module does not check or warn if these conditions have not been met.

EENNCCOODDIINNGG AANNDD UUTTFF--88
       See the 'ENCODING AND UTF-8' section of vCard::AddressBook.

MMEETTHHOODDSS
   llooaadd__hhaasshhrreeff(($$hhaasshhrreeff))
       $hashref should look like this:

           full_name    => 'Bruce Banner, PhD',
           given_names  => ['Bruce'],
           family_names => ['Banner'],
           title        => 'Research Scientist',
           photo        => 'http://example.com/bbanner.gif',
           phones       => [
               { type => ['work'], number => '651-290-1234', preferred => 1 },
               { type => ['cell'], number => '651-290-1111' },
           },
           addresses => [
               { type => ['work'], ... },
               { type => ['home'], ... },
           ],
           email_addresses => [
               { type => ['work'], address => 'bbanner@shh.secret.army.mil' },
               { type => ['home'], address => 'bbanner@timewarner.com' },
           ],

       Returns $self in case you feel like chaining.

   llooaadd__ffiillee(($$ffiilleennaammee))
       Returns $self in case you feel like chaining.

   llooaadd__ssttrriinngg(($$ssttrriinngg))
       Returns $self in case you feel like chaining.  This method assumes
       $string is decoded (but not MIME decoded).

   _a_s___s_t_r_i_n_g_(_)
       Returns the vCard as a string.

   aass__ffiillee(($$ffiilleennaammee))
       Write data in vCard format to $filename.

       Dies if not successful.

SSIIMMPPLLEE GGEETTTTEERRSS//SSEETTTTEERRSS
       These methods accept and return strings.

   _v_e_r_s_i_o_n_(_)
       Version number of the vcard.  Defaults to '4.0'

   _f_u_l_l___n_a_m_e_(_)
       A person's entire name as they would like to see it displayed.

   _t_i_t_l_e_(_)
       A person's position or job.

   _p_h_o_t_o_(_)
       This should be a link. Accepts a string or a URI object.  This method
       always returns a URI object.

       TODO: handle binary images using the data uri schema

   _b_i_r_t_h_d_a_y_(_)
   _t_i_m_e_z_o_n_e_(_)
CCOOMMPPLLEEXX GGEETTTTEERRSS//SSEETTTTEERRSS
       These methods accept and return array references rather than simple
       strings.

   _f_a_m_i_l_y___n_a_m_e_s_(_)
       Accepts/returns an arrayref of family names (aka surnames).

   _g_i_v_e_n___n_a_m_e_s_(_)
       Accepts/returns an arrayref.

   _o_t_h_e_r___n_a_m_e_s_(_)
       Accepts/returns an arrayref of names which don't qualify as
       family_names or given_names.

   _h_o_n_o_r_i_f_i_c___p_r_e_f_i_x_e_s_(_)
       Accepts/returns an arrayref.  eg "[ 'Dr.' ]"

   _h_o_n_o_r_i_f_i_c___s_u_f_f_i_x_e_s_(_)
       Accepts/returns an arrayref.  eg "[ 'Jr.', 'MD' ]"

   _p_h_o_n_e_s_(_)
       Accepts/returns an arrayref that looks like:

         [
           { type => ['work'], number => '651-290-1234', preferred => 1 },
           { type => ['cell'], number => '651-290-1111' },
         ]

   _a_d_d_r_e_s_s_e_s_(_)
       Accepts/returns an arrayref that looks like:

         [
           { type => ['work'], street => 'Main St', preferred => 0 },
           { type      => ['home'],
             pobox     => 1234,
             extended  => 'asdf',
             street    => 'Army St',
             city      => 'Desert Base',
             region    => '',
             post_code => '',
             country   => 'USA',
             preferred => 1,
           },
         ]

   _e_m_a_i_l___a_d_d_r_e_s_s_e_s_(_)
       Accepts/returns an arrayref that looks like:

         [
           { type => ['work'], address => 'bbanner@ssh.secret.army.mil' },
           { type => ['home'], address => 'bbanner@timewarner.com', preferred => 1 },
         ]

AAUUTTHHOORR
       Eric Johnson (kablamo), github ~!at!~ iijo dot org

AACCKKNNOOWWLLEEDDGGEEMMEENNTTSS
       Thanks to Foxtons <http://foxtons.co.uk> for making this module
       possible by donating a significant amount of developer time.



perl v5.18.2                      2014-02-14                          vCard(3)
Something went wrong with that request. Please try again.