[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Odp: [coldsync-hackers] p5-palm: problem using raw.pm



> Hi !
>
> I have written a little program to save signatures as a bunch of vectors
in a
> PalmDB and just want to dump the data with the raw-module.
>
> I checked the data with pdbdump and it looks fine.
> But i can't grab the right data out of the records-array. My Code:
>
> use Palm::Raw;
> $pdb = new Palm::Raw;
> $pdb->Load("StrokeDB.pdb");
> print $pdb->{appinfo};
> print "\n";
>
> $z=0;
>
> foreach $eintrag (@{$pdb->{records}}){
>
>     $entry = (@{$pdb->{records}});
>     print ("Entry Nr $z : " . $entry . "\n");
>     ($x,$y,$oldx,$oldy,$t) = unpack("ssssL", $entry);
>     print "$x , $y , $oldx, $oldy, $t\n";
> }
>
>
> I think something is wrong with the dereferenzing of the hash and the
access
> to the array, because output is like:
>
> Entry Nr 0 : HASH(0x811fab8)
> 16712 , 18515 , 12328, 14456, 1634087217
>
> But x,y,old,oldy are ccordinates and t is much more smaller
>


I forgot :     ($x,$y,$oldx,$oldy,$t) = unpack("ssssL", $entry);
Palm (if contains Motorola) is a big-endian so it should be that way:
    ($x,$y,$oldx,$oldy,$t) = unpack("nnnnL", $entry);
see man perlfunc about pack.




-- 
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.