in reply to calling perl from C [performance optimization]

you should certainly read perldoc perlipc, which comes with Perl distribution. Very useful reading, from many points of view.

Also, as FAQ says, use Inline::C; from CPAN should fit, it will give you a breakthrough speed boost with a little efforts.