[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[coldsync-hackers] Writing conduits
By the way, for those of you beginners trying to write coldsync conduits
in Perl and looking for the right place to start, I think that you will
find that Data::Dumper is your best friend.
Consider the following conduit for the address book:
-------------------------------------------------
#!/usr/bin/perl
use Palm::Address;
use ColdSync;
StartConduit("dump");
$OUTFILE = "$ENV{HOME}/.palm/address";
print "outfile = $OUTFILE\n";
open OUTFILE, "> $OUTFILE" or die("401 Can't open $OUTFILE: $!\n");
select OUTFILE;
use Data::Dumper;
print Dumper($PDB);
close OUTFILE;
EndConduit;
-----------------------------------------------------
Upon running this, you'll find that the specified file contains a
representation of your address book as a Perl complex data structure - a
hash of hashes of hashes, in this case. Once you see this output (that
is, if you grok Perl) it is immediately obvious what you need to do to
move on.
--
Rich Bowen -- Director of Web Application Development
http://www.cre8tivegroup.com/ -- rich@cre8tivegroup.com
Have trouble remembering things? http://www.mymissinghead.com/
--
This message was sent through the coldsync-hackers mailing list. To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body. For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.