Palm::PDB: How to compose a PDB?

J

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
class which exports the ParseAppInfoBlock() and ParseRecord() methods
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
version is PDB.pm,v 1.36).

#! /usr/bin/perl

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

my $dst = Palm::pDB->new({ name => 'TEST',
creator => 'DBOS',
type => '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) = @_;
my $appinfo;

# construct appinfo from $self->{appinfo}

return $appinfo;
}
1;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top