If you want to call
C from Perl, start with the perlxstut manpage man page, moving on to the perlxs manpage, xsubpp, and the perlguts manpage. If you want to call Perl from
C, then read the perlembed manpage, the perlcall manpage, and
the perlguts manpage. Don't forget that you can learn a lot from looking at how the authors of
existing extension modules wrote their code and solved their problems.