Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl and C communication

Reply
Thread Tools

Perl and C communication

 
 
simone.romano82@gmail.com
Guest
Posts: n/a
 
      01-12-2008
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
 
Reply With Quote
 
 
 
 
Dr.Ruud
Guest
Posts: n/a
 
      01-12-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) schreef:

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


perldoc perlipc

--
Affijn, Ruud

"Gewoon is een tijger."
 
Reply With Quote
 
 
 
 
Joost Diepenmaat
Guest
Posts: n/a
 
      01-12-2008
(E-Mail Removed) 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...-Communication

> Thanks in advance
> Simo


Cheers,
Joost.
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      01-12-2008
(E-Mail Removed) 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveState Perl and MinGW [was: Perl 5.14 Windows Strawberry Perl 64 bits] Dilbert Perl Misc 0 11-10-2011 02:20 PM
Bidirectional communication between Perl and C fjliu2004@gmail.com Perl Misc 7 01-10-2006 03:34 AM
VB6 and Perl on 2000/XP: Req recommendation for interprocess communication Tom Bates Perl Misc 0 06-04-2005 12:24 PM
Communication between Cgi and another perl application Giojo Perl Misc 2 12-13-2004 02:08 PM
perl threads and inter thread communication brad Perl Misc 2 02-16-2004 09:44 AM



Advertisments