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:DB::RegisterPDBHandlers().
However, when trying to write a PDB file, I get the error message
Can't locate object method "PackAppInfoBlock" via package "Palm:DB" 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:DB.
Here's an attempt at a minimal script which requires Palm:DB (my
version is PDB.pm,v 1.36).
#! /usr/bin/perl
BEGIN { unshift @INC, '.' }
use warnings;
use strict;
use Palm:DB;
use DBOSDB00;
my $dst = Palm:DB->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:DB;
sub import {
print STDERR "import of DBOSDB00\n";
&Palm:DB::RegisterPDBHandlers(__PACKAGE__, [ "DBOS", "DB00" ]);
}
sub PackAppInfoBlock {
my ($self) = @_;
my $appinfo;
# construct appinfo from $self->{appinfo}
return $appinfo;
}
1;
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:DB::RegisterPDBHandlers().
However, when trying to write a PDB file, I get the error message
Can't locate object method "PackAppInfoBlock" via package "Palm:DB" 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:DB.
Here's an attempt at a minimal script which requires Palm:DB (my
version is PDB.pm,v 1.36).
#! /usr/bin/perl
BEGIN { unshift @INC, '.' }
use warnings;
use strict;
use Palm:DB;
use DBOSDB00;
my $dst = Palm:DB->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:DB;
sub import {
print STDERR "import of DBOSDB00\n";
&Palm:DB::RegisterPDBHandlers(__PACKAGE__, [ "DBOS", "DB00" ]);
}
sub PackAppInfoBlock {
my ($self) = @_;
my $appinfo;
# construct appinfo from $self->{appinfo}
return $appinfo;
}
1;