.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "vCard 3pm" .TH vCard 3pm "2014-06-12" "perl v5.18.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" vCard \- Read, write, and edit vCards .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& 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(\*(AqBruce Banner, PhD\*(Aq); \& $vcard\->title(\*(AqResearch Scientist\*(Aq); \& $vcard\->photo(\*(Aqhttp://example.com/bbanner.gif\*(Aq); \& \& # complex getters/setters \& $vcard\->phones({ \& { type => [\*(Aqwork\*(Aq, \*(Aqtext\*(Aq], number => \*(Aq651\-290\-1234\*(Aq, preferred => 1 }, \& { type => [\*(Aqhome\*(Aq], number => \*(Aq651\-290\-1111\*(Aq } \& }); \& $vcard\->email_addresses({ \& { type => [\*(Aqwork\*(Aq], address => \*(Aqbbanner@ssh.secret.army.mil\*(Aq }, \& { type => [\*(Aqhome\*(Aq], address => \*(Aqbbanner@timewarner.com\*(Aq }, \& }); \& \& # these methods output data in vCard format \& my $file = $vcard\->as_file($filename); # writes to $filename \& my $string = $vcard\->as_string; # returns a string .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" A vCard is a digital business card. vCard and vCard::AddressBook provide an \&\s-1API\s0 for parsing, editing, and creating vCards. .PP This module is built on top of Text::vCard. It provides a more intuitive user interface. .PP To handle an address book with several vCard entries in it, start with vCard::AddressBook and then come back to this module. .PP Note that the vCard \s-1RFC\s0 requires \fIversion()\fR and \fIfull_name()\fR. This module does not check or warn if these conditions have not been met. .SH "ENCODING AND UTF\-8" .IX Header "ENCODING AND UTF-8" See the '\s-1ENCODING AND UTF\-8\s0' section of vCard::AddressBook. .SH "METHODS" .IX Header "METHODS" .SS "load_hashref($hashref)" .IX Subsection "load_hashref($hashref)" \&\f(CW$hashref\fR should look like this: .PP .Vb 10 \& full_name => \*(AqBruce Banner, PhD\*(Aq, \& given_names => [\*(AqBruce\*(Aq], \& family_names => [\*(AqBanner\*(Aq], \& title => \*(AqResearch Scientist\*(Aq, \& photo => \*(Aqhttp://example.com/bbanner.gif\*(Aq, \& phones => [ \& { type => [\*(Aqwork\*(Aq], number => \*(Aq651\-290\-1234\*(Aq, preferred => 1 }, \& { type => [\*(Aqcell\*(Aq], number => \*(Aq651\-290\-1111\*(Aq }, \& }, \& addresses => [ \& { type => [\*(Aqwork\*(Aq], ... }, \& { type => [\*(Aqhome\*(Aq], ... }, \& ], \& email_addresses => [ \& { type => [\*(Aqwork\*(Aq], address => \*(Aqbbanner@shh.secret.army.mil\*(Aq }, \& { type => [\*(Aqhome\*(Aq], address => \*(Aqbbanner@timewarner.com\*(Aq }, \& ], .Ve .PP Returns \f(CW$self\fR in case you feel like chaining. .SS "load_file($filename)" .IX Subsection "load_file($filename)" Returns \f(CW$self\fR in case you feel like chaining. .SS "load_string($string)" .IX Subsection "load_string($string)" Returns \f(CW$self\fR in case you feel like chaining. This method assumes \f(CW$string\fR is decoded (but not \s-1MIME\s0 decoded). .SS "\fIas_string()\fP" .IX Subsection "as_string()" Returns the vCard as a string. .SS "as_file($filename)" .IX Subsection "as_file($filename)" Write data in vCard format to \f(CW$filename\fR. .PP Dies if not successful. .SH "SIMPLE GETTERS/SETTERS" .IX Header "SIMPLE GETTERS/SETTERS" These methods accept and return strings. .SS "\fIversion()\fP" .IX Subsection "version()" Version number of the vcard. Defaults to '4.0' .SS "\fIfull_name()\fP" .IX Subsection "full_name()" A person's entire name as they would like to see it displayed. .SS "\fItitle()\fP" .IX Subsection "title()" A person's position or job. .SS "\fIphoto()\fP" .IX Subsection "photo()" This should be a link. Accepts a string or a \s-1URI\s0 object. This method always returns a \s-1URI\s0 object. .PP \&\s-1TODO:\s0 handle binary images using the data uri schema .SS "\fIbirthday()\fP" .IX Subsection "birthday()" .SS "\fItimezone()\fP" .IX Subsection "timezone()" .SH "COMPLEX GETTERS/SETTERS" .IX Header "COMPLEX GETTERS/SETTERS" These methods accept and return array references rather than simple strings. .SS "\fIfamily_names()\fP" .IX Subsection "family_names()" Accepts/returns an arrayref of family names (aka surnames). .SS "\fIgiven_names()\fP" .IX Subsection "given_names()" Accepts/returns an arrayref. .SS "\fIother_names()\fP" .IX Subsection "other_names()" Accepts/returns an arrayref of names which don't qualify as family_names or given_names. .SS "\fIhonorific_prefixes()\fP" .IX Subsection "honorific_prefixes()" Accepts/returns an arrayref. eg \f(CW\*(C`[ \*(AqDr.\*(Aq ]\*(C'\fR .SS "\fIhonorific_suffixes()\fP" .IX Subsection "honorific_suffixes()" Accepts/returns an arrayref. eg \f(CW\*(C`[ \*(AqJr.\*(Aq, \*(AqMD\*(Aq ]\*(C'\fR .SS "\fIphones()\fP" .IX Subsection "phones()" Accepts/returns an arrayref that looks like: .PP .Vb 4 \& [ \& { type => [\*(Aqwork\*(Aq], number => \*(Aq651\-290\-1234\*(Aq, preferred => 1 }, \& { type => [\*(Aqcell\*(Aq], number => \*(Aq651\-290\-1111\*(Aq }, \& ] .Ve .SS "\fIaddresses()\fP" .IX Subsection "addresses()" Accepts/returns an arrayref that looks like: .PP .Vb 10 \& [ \& { type => [\*(Aqwork\*(Aq], street => \*(AqMain St\*(Aq, preferred => 0 }, \& { type => [\*(Aqhome\*(Aq], \& pobox => 1234, \& extended => \*(Aqasdf\*(Aq, \& street => \*(AqArmy St\*(Aq, \& city => \*(AqDesert Base\*(Aq, \& region => \*(Aq\*(Aq, \& post_code => \*(Aq\*(Aq, \& country => \*(AqUSA\*(Aq, \& preferred => 1, \& }, \& ] .Ve .SS "\fIemail_addresses()\fP" .IX Subsection "email_addresses()" Accepts/returns an arrayref that looks like: .PP .Vb 4 \& [ \& { type => [\*(Aqwork\*(Aq], address => \*(Aqbbanner@ssh.secret.army.mil\*(Aq }, \& { type => [\*(Aqhome\*(Aq], address => \*(Aqbbanner@timewarner.com\*(Aq, preferred => 1 }, \& ] .Ve .SH "AUTHOR" .IX Header "AUTHOR" Eric Johnson (kablamo), github ~!at!~ iijo dot org .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Thanks to Foxtons for making this module possible by donating a significant amount of developer time.