Perl and C communication

Discussion in 'Perl Misc' started by simone.romano82@gmail.com, Jan 12, 2008.

  1. Guest

    Hi
    I'm new in Perl language...

    I have an important question: Perl and C can communicate ?

    My problem is the following: I have Perl script (client) that could
    receive information ( via UDP connection) from a C program ( the
    server).
    Is it this possible? there are a method for client e server to
    communicate??

    Thanks in advance
    Simo
    , Jan 12, 2008
    #1
    1. Advertising

  2. Dr.Ruud Guest

    schreef:

    > Is it this possible? there are a method for client e server to
    > communicate??


    perldoc perlipc

    --
    Affijn, Ruud

    "Gewoon is een tijger."
    Dr.Ruud, Jan 12, 2008
    #2
    1. Advertising

  3. writes:

    > Hi
    > I'm new in Perl language...
    >
    > I have an important question: Perl and C can communicate ?
    >
    > My problem is the following: I have Perl script (client) that could
    > receive information ( via UDP connection) from a C program ( the
    > server).
    > Is it this possible? there are a method for client e server to
    > communicate??


    Yes it's possible and all the methods you'd need are in the perl base
    language itself, though you may want to check out IO::Socket and friends
    on search.cpan.org for a slightly easier to use interface.

    The language that the server is written in or even the machine that it's
    running on shouldn't make any difference. That's one of the points of
    using sockets in the first place. If the data you're sending is in some
    very complex binary format (instead of line-delimited text, for
    instance) things could get a little more complicated - though it's still
    very much possible to deal with that.

    This seems like as good a place as any to start:
    http://perldoc.perl.org/perlipc.html#Sockets:-Client/Server-Communication

    > Thanks in advance
    > Simo


    Cheers,
    Joost.
    Joost Diepenmaat, Jan 12, 2008
    #3
  4. wrote:
    >I have an important question: Perl and C can communicate ?


    No. Those are programming languages and programming languages don't
    communicate with each other (*).

    (*): Well, there is embedded C, but that's probably not what you are talking
    about.

    >My problem is the following: I have Perl script (client) that could
    >receive information ( via UDP connection) from a C program ( the
    >server).
    >Is it this possible? there are a method for client e server to
    >communicate??


    This on the other hand is no problem at all. Perl supports all the usual
    methods of IPC (interprocess communication) and there are modules for pretty
    much any client-server communication protocol available. Check out CPAN,
    chances are very high that you will find a ready-made solution.

    jue
    Jürgen Exner, Jan 12, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. brad
    Replies:
    2
    Views:
    494
    Ian Cass
    Feb 16, 2004
  2. Hannes
    Replies:
    3
    Views:
    329
    Hannes
    Mar 3, 2004
  3. Giojo
    Replies:
    2
    Views:
    127
    Bart Lateur
    Dec 13, 2004
  4. Tom Bates
    Replies:
    0
    Views:
    119
    Tom Bates
    Jun 4, 2005
  5. Replies:
    7
    Views:
    424
Loading...

Share This Page