Hello All,

I need to use a C header file in Perl program in Unix.

Is it possible to use the header files from perl in any way? I do not want
to use any modules for the same.

I do not want to enable the perl program to call a routine in C library
through XS. I just want to use the values rather than any code.


For example, Consider "headerfile.h":

Within that header file, i define a structure like this:

struct sample {
   int x;
};

Then in my C program I might do the following:

#include <stdio.>
#include "headerfile.h"

int
main(void)
{
   printf("The size of a headerfile is %d\n",sizeof(headerfile));
   return 0;
}

Can i do the same in Perl?

I kindly request to guide me in the same.

Thanks and Regards,
Dharshana

Reply via email to