in reply to Re: Re: examples using Palm::Addressbook?
in thread examples using Palm::Addressbook?

fractureMech,
Ok - I was working completely blind there since I don't have a Palm myself. The docs as you have noticed are poor and that is all I had to go on. I will install the module and create a brand new PDB and then work backwards, trying to read my records back in after the fact. I will /msg you when I am complete and update this node.

Cheers - L~R

Update: After messing around I was able to create a PDB without the use of a Palm Pilot and read it back in. I am not sure what your problem is, so I will either need a copy of your PDB, or would need you to execute the following piece of code and tell me what you get:

#!/usr/bin/perl -w use strict; use Palm::PDB; use Palm::Address; use Data::Dumper; my $pdb = new Palm::PDB; $pdb->Load("myfile.pdb") or die "Unable to attach to address book"; my $record = $pdb->{records}[0]; print Dumper($record);

Replies are listed 'Best First'.
Re: examples using Palm::Addressbook?
by fractureMech (Initiate) on Sep 08, 2003 at 02:51 UTC
    A much simpler example program is here: http://sourceforge.net/projects/webpdb/ I get the same errors when I cut down the above script to be (as a first step):
    #!/usr/bin/perl -w #use strict; use Palm::PDB; use Palm::Address; my $p = new Palm::PDB; $p->Load( $ARGV[0] ) || die "Error loading $ARGV[0]\n"; my @categories = @{$p->{appinfo}{categories}}; for my $catid (@categories ) { my $cat = $categories[$catid]; if( $cat->{name} ) { print "$cat->{name}\n"; } for my $rec ( sort { $a->{fields}->{name} cmp $b->{fields}->{name} | +| $a->{fields}->{firstName} cmp $b->{fields}->{firstName} } @{ $p->{r +ecords} } ) { print "$rec->{fields}->{firstName} $rec->{fields}->{name}\n"; } }