Striider has asked for the wisdom of the Perl Monks concerning the following question:

At work we do our work from two different locations. One part is on HP's and another is on our development station. On the development station we used to have another card that ran unix on its backplane, and it gave us easy access to the memory. However now, we dont have that access so we have been porting over our gui's (written in tcl/tk with embedded C) to a client server relationship to manipulate the memory on the development station. We have a lot of structs used in the C code for the guis and were trying to use perl to send the correct info to the server for read and write operations. Is there a way that I can use inline to load our old C and tie the C variables so they communicate read and write to the server? How can I do tie a C variable like how perl does?

Replies are listed 'Best First'.
Re: tieing variables
by mortis (Pilgrim) on Dec 07, 2001 at 20:39 UTC
    I don't think there is an easy way to just tie a C data structure to a Perl object. You can write a Perl object/module to wrap the C struct though. The Inline might even make that task easier, but Inline tends to be a bit harder to maintain than just writing your own module and XS code.

    There is a section titled "Perl Objects And C Structures" in the perlxs manpage that will probably help point you in the right direction.

    I'm sure you can acheive what you want, it just might be a bit of work to do it.

A reply falls below the community's threshold of quality. You may see it by logging in.