Palm::PDB: How to compose a PDB?

Palm::PDB: How to compose a PDB?

am 16.08.2007 16:29:47 von Josef Moellers

Hi,

I am trying to convert between a Palm PDB "database" file and a CSV file.=

Reading the PDB and writing the CSV is pretty easy: I write a helper=20
class which exports the ParseAppInfoBlock() and ParseRecord() methods=20
and registers itself by calling Palm::PDB::RegisterPDBHandlers().
However, when trying to write a PDB file, I get the error message

Can't locate object method "PackAppInfoBlock" via package "Palm::PDB" at =

/usr/local/share/perl/5.8.8/Palm/PDB.pm line 1080.

My helper file does define a PackAppInfoBlock() method, but, apparently, =

this isn't picked up by Palm::PDB.

Here's an attempt at a minimal script which requires Palm::PDB (my=20
version is PDB.pm,v 1.36).

#! /usr/bin/perl

BEGIN { unshift @INC, '.' }
use warnings;
use strict;
use Palm::PDB;
use DBOSDB00;

my $dst =3D Palm::PDB->new({ name =3D> 'TEST',
creator =3D> 'DBOS',
type =3D> 'DB00'});

$dst->Write('TEST.pdb');
exit 0;


This module to be placed in same directory as main script

package DBOSDB00;

use warnings;
use strict;
use Palm::PDB;

sub import {
print STDERR "import of DBOSDB00\n";
&Palm::PDB::RegisterPDBHandlers(__PACKAGE__, [ "DBOS", "DB00" ]);
}

sub PackAppInfoBlock {
my ($self) =3D @_;
my $appinfo;

# construct appinfo from $self->{appinfo}

return $appinfo;
}
1;

--=20
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html