Another solution is to use pack and unpack to take the C structure and convert it back-and-forth into an appropriate Perl structure. A small
example of this can be found on the current sample page for my
book.
There may also be an example in the proposed perlpacktut that's been floating around the perl 5 porters mailing list.