I using the above Perl Module from CPAN to loop through each vCard in a .vcf file and saving the results to a database. All of the information is pulled correctly with the exception of the data for the PHOTO node. It seems that it picks the PHOTO node at random rather than the PHOTO node for that specific vCard and I am not sure why. Here is my code:
if($p{'vcard'} =~ m/\.vcf/){ <br/> my $vcard_file = $cgi->upload('vcard'); <br/> my $vcard_list = Text::vCard::Addressbook->new({ 'source_file' => +$vcard_file });<br/> foreach my $vcard ($vcard_list->vcards()){<br/> ...<br/> ...<br/> ...<br/> my $photo = $vcard->get({ 'node_type' => 'photo' }); <br/> my $contact_photo = $photo->[0]->value();<br/> #decodes it with MIME::Base64<br/> #uses Image::Magick to write it as jpg and save to directory<br/ +> ...<br/> ...<br/> ...<br/> }<br/> }<br/>

In reply to Text::vCard::Addressbook Photo Node by omg_wtf_lol

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.