in reply to Perl and Palm Files

I believe the CPAN palm module lets you create empty Palm::PDB objects (the super class of each specific type of database), populate them, and write them back out to disk. Take a look at perldoc Palm::PDB.

As a secondary point: You're post didn't specificly mention that you wanted to sync these databases with a handhelded, but assuming you do, keep in mind that just creating a .pdb is only half the battle. Unless your conduit understands what's going on, you could find yourself adding duplicate records, or blowing away data entered manually on the handheld.

"Syncing" happens in the conduits themselves, and each conduit decides how to handle merging, so instead of writting a script to generate a .pdb from some data, and then worrying about how your syncing conduit will deal with it, you might just wnat to write a conduit that imports the data directly.

If you're developing on Unix, your HotSyncing program is probably built on top of pilot-link -- the www site has lots of links with information on writting conduits.

Replies are listed 'Best First'.
Re: Re: Perl and Palm Files
by Beatnik (Parson) on Feb 03, 2002 at 23:10 UTC
    He actually mentions he exported/imported his addresses and dates, those formats are supported by p5-Palm. If those files are synced (with pilot-link or whatever he uses, you can easily grab the files.

    As long as the ID is unique (well, randomly enough), I see no problem in generating new records. The updated code listed above can be used as a framework for any of the PDB types p5-Palm supports :)

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.
Re: Re: Perl and Palm Files
by Ryszard (Priest) on Feb 03, 2002 at 23:01 UTC
    Thanks for the tip hossman.

    My application is web based, and will allow for the uploading of an (address|date|et al).pdb for the migrating of the data into an sql database, and will also allow for the downloading of a .pdb file (ie it will be created from scratch via an SQL database).

    I havent put much too much thought into duplicate records yet.. perhaps i'll use store an MD5 (or sha1) of the record in the database.

    I guess i've got a lot more thinking/planning to do.

      Palm handles duplicate records thru IDs... (see my above listed code on adding a record). If you have the ID in the SQL DB (like I did on my project), and you make that field the unique record key, you can trap any duplicates from being added.

      In other words, a record is only duplicate if you consider it duplicate :)

      Greetz
      Beatnik
      ... Quidquid perl dictum sit, altum viditur.