in reply to Need a Help - calling C program from Perl
This is somewhat off topic and my C skills aren't exceptionally sharp, but aren't you asking for trouble by returning a pointer allocated within your function?