|
NAMENet::vFile - Generic module which can read and write "vFile" files such as vCard (RFC 2426) and vCalendar (RFC 2445). The result of loading this data is a collection of objects which will grant you easy access to the properties. Then the module can write your objects back to a data file.SYNOPISuse Net::vCard; my $cards = Net::vCard->loadFile( "foo.vCard", "blort.vCard", "whee.vCard" ); foreach my $card (@$cards) { spam ( $card->EMAIL('default') ); } DETAILSThe way this processor works is that it reads the vFile line by line.1 - BEGIN:(.*) tag $1 is looked up in classMap; class is loaded; new object of this class is created ie/ $Net::vFile::classMap{'VCARD'}="Net::vCard"; $object=$classMap{'VCARD'}->new; n.b. classMap is a package variable for Net::vFile 2 - All lines are read and stored until a BEGIN tag (goto 1) or END tag (goto 3) is reached 3 - END:(.*) tag Signals that all entry data has been obtained and now the rows of data are processed 4 - Data is concatenated - thanks to Net::iCal for the strategy; the tag label and data are obtained 5 - The data handler is identified via $object->varHandler->{$label} There are some generic handlers for common data types such as simple strings, dates, etc. More elaborate data types such as N, ADR, etc. need special treatment and are declared explititly in classes as "load_XXX" such as "load_N" You should be able to override and extend the processing by taking Net::vCard.pm as your example and adjusting as necessary. The resulting data structure is a bit bulky - but is such that it can express vCard data completely and reliably Put in a dump of a vCard here DEPENDENCIESDateTime::Format::ICal
DATA HANDLERS
SUPPORTFor technical support please email to jlawrenc@cpan.org ... for faster service please include "Net::vFile" and "help" in your subject line.AUTHORJay J. Lawrence - jlawrenc@cpan.org Infonium Inc., Canada http://www.infonium.ca/ COPYRIGHTCopyright (c) 2003 Jay J. Lawrence, Infonium Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.The full text of the license can be found in the LICENSE file included with this module. ACKNOWLEDGEMENTSNet::iCal - whose loading code inspired me for mine SEE ALSORFC 2426, Net::iCal
Visit the GSP FreeBSD Man Page Interface. |