Well i think I figured out the steps I'm going to take. I found a great site
http://www.steve.gb.com/perl/lesson14.html and i believe the solution for me will be to break up my hilbert.c file and take it function by function and make sure that the definitions correctly match PERL datatypes. I have printed out perlapi and perl guts and hopefully will be successfull. I wonder if the hilbert.h file has to be adjusted too? It sucks that you can't just cut and paste, that would be really cool!, but I'm not above trudging through it, just going to take a while......