[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [coldsync-hackers] p5-Palm perl module
- To: coldsync-hackers at lusars dot net
- Subject: Re: [coldsync-hackers] p5-Palm perl module
- From: Andrew Arensburger <arensb+CShackers at ooblick dot com>
- Date: Tue, 28 Jan 2003 09:09:25 -0500
- In-reply-to: <1043733443.16392.80.camel@fuzzymonkey.etowns.net>; from mike@fuzzymonkey.org on Tue, Jan 28, 2003 at 12:57:23AM -0500
- References: <1043733443.16392.80.camel@fuzzymonkey.etowns.net>
- Reply-to: coldsync-hackers at lusars dot net
- Sender: owner-coldsync-hackers at lusars dot net
- User-agent: Mutt/1.2.5.1i
On Tue, Jan 28, 2003 at 12:57:23AM -0500, Michael D. Spiceland wrote:
> Does anyone have a simple example using the p5-palm perl module. I
> just want to open the datebook PDB, read out a few of the entries,
> perhaps add some new ones, and save it again. If I had an example of
> something similar to this, I would surely be able to figure out how to
> do what I need.
Try this: copy ~/.palm/backup/Datebook.pdb to /tmp/foo.pdb,
and run the following script:
#!/usr/bin/perl
use strict;
use Palm::Datebook;
use vars qw( $pdb );
$pdb = new Palm::PDB;
$pdb->Load("/tmp/foo.pdb");
foreach my $record (@{$pdb->{records}})
{
$record->{description} =~ s/meeting/waste of time/ig;
}
$pdb->Write("/tmp/bar.pdb");
You can use 'pdbdump' to compare /tmp/foo.pdb and /tmp/bar.pdb, and
note that "meeting" has been replaced with "waste of time".
--
Andrew Arensburger This message *does* represent the
arensb@ooblick.com views of ooblick.com
Drink Canada Dry! You might not succeed, but it *is* fun trying.
--
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.