Leser: 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/usr/bin/perl use Text::vCard; use Text::vCard::Addressbook; my $address_book = Text::vCard::Addressbook->new(); my $vcard = $address_book->add_vcard(); $vcard->fullname('Maxine Mustermann'); $addresses = $vcard->get({ 'node_type' => 'addresses' }); $addresses->[0]->street('The burrows'); $addresses->[0]->region('Wimbeldon common'); my $vcf_file = $address_book->export(); print ("$vcf_file");
QuoteCan't call method "street" on an undefined value at ./vcardclean.pl line 10.
2009-03-26T16:12:12 #Kein KommentarSollte eigentlich gehen, denn ich will ja ein ganz neues vCard-Adressbuch erzeugen.kenn mich mit dem modul nicht aus, aber bist du sicher, dass du vorher keine adressen eingeben musst und die funktion trotzdem adressen zurückliefert?
Quotejaja, dann fehlt noch ein my in Zeile 9... ;)benutze außerdem mal use strict und use warnings am anfang des scriptes
QuoteHab's mir gestern vom CPAN runtergeladen. Die Versionsnummer ist 2.03.welche version von dem modul hast du denn?
1 2 3 4 5 6 7 8 9 10
my $vcard = Text::vCard::Addressbook->new()->add_vcard(); # Add a node to it my $address = $vcard->add_node({ 'node_type' => 'ADR', }); # Add some data to the address. $address->street('19 The mews'); $address->city('Buffyvill');
2009-03-26T16:41:13 reneeProbier mal
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/usr/bin/perl use strict; use warnings; use Text::vCard; use Text::vCard::Addressbook; #my $address_book = Text::vCard::Addressbook->new(); my $vcard = Text::vCard::Addressbook->new()->add_vcard(); # Add a node to it my $address = $vcard->add_node({ 'node_type' => 'ADR', }); # Add some data to the address. $address->street('19 The mews'); $address->city('Buffyvill'); #my $vcf_file = $address_book->export(); my $vcf_file = $vcard->export(); print ("$vcf_file");
QuoteCan't locate object method "export" via package "Text::vCard" at ./vcardclean2.pl line 21.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/perl use strict; use warnings; use Text::vCard; use Text::vCard::Addressbook; my $address_book = Text::vCard::Addressbook->new(); my $vcard = $address_book->add_vcard(); # Add a node to it my $address = $vcard->add_node({ 'node_type' => 'ADR', }); # Add some data to the address. $address->street('19 The mews'); $address->city('Buffyvill'); my $vcf_file = $address_book->export(); print ("$vcf_file");