Hello!
I'm trying to find information on using sockets to communicate between 2 Perl scripts running on the same machine, but I've had little luck to date... that info which I can find is all relating to IP sockets over the Internet. The Camel book has some, but written in a way that could make a sockets novice openly weep (for instance: "NAME should be a packed network address of the proper type for the socket"). I've heard rumors that the Perl Cookbook has good examples of it, but my local Barnes and Noble didn't have that one in stock, so I thought I'd see if anyone here could offer help.
Can anyone possibly trouble themselves to post snippets of what the two scripts might look like to pass info between one another via sockets? Although they're on the same machine, one will play a server role, the other a client... the server will wait for and respond to requests from the client. I can figure out the error checking and ugly details, I just need to catch a glimpse of the basic concept in code.
Thanks a whole bunch,
Alan "Hot Pastrami" Bellows
-Sitting calmly with scissors-
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.