Basically, you'd need to write a piece of XS code (or Inline::CPP code that will be turned into XS for you) that takes the data found on the specific memory location, and turns that in the appropriate Perl datastructure. The Perl API has lots of helper functions to create Perl datastructures.