in reply to Re^3: communication between C and perl
in thread communication between C and perl

Yeah, thats weird. I probably cheated on the way line is defined, and my compiler automagically fixed it. Instead of
char *line; /* try */ char line[256];
C is very finicky about allocating space for strings, and will segfault without telling why. This is one of the primary reasons people like Perl over C.

Try this free book: Advanced Linux Programming and read the chapter on IPC.

The difference between my script and your's using &63, is that mine uses a named-pipe which can be accessed by different process. Using &63, you are using a shared filehandle referenced by it's fileno, and requires that both scripts share them..... that means 1 script must fork off the other, instead of them being started separately. Of course, I'm not an expert c programmer, so take that with a grain of salt. This isn't the place to discuss c anyways.


I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re^5: communication between C and perl
by jeanluca (Deacon) on Feb 09, 2007 at 19:03 UTC
    thnx, it works!