http://qs321.pair.com?node_id=102397


in reply to Sending packed arrays from Perl to C

You use integers in getangles so pack them as integers.
# my $packedRow= pack("f$width", @$avRow); my $packedRow= pack("i$width", @$avRow);
You want to add each row to packedMatrix rather than overwrite it each time.
# $packedMatrix = pack("p", $packedRow); $packedMatrix .= pack("P", $packedRow);

With these changes the code works on my machine.