All depends what you really need... if you want simply to have one script
send data to another script over a network, use IO::Socket
it will do exactly what you want...
however, if you're looking into threads, i can tell you that decent thread
support for perl will (hopefully) be available when 5.8 gets released, but
it's all a bit unsure...
Otoh, you could look into POE, which is perl's timesliced kernel so to
speak... you can find it at poe.perl.org, but mind you, it will take a bit
to wrap your head around but will allow you to 'multithread' (really
timeslicing, but with most socket connections you have time to spare) using
perl.

i should have some sample code using sockets under POE, so if you choose
this route, let me know.

hth,

Jos Boumans

<snip>

> Hi,
>
> I am very new to perl. In fact, I am trying to write my first perl app
> ever. I would like it to do peer to peer networking. I have always been
> a C programmer and if I wanted to do this in C I would use threads and
> have one accepting connections and one initiating connections. Well, I
> read that thread support for perl was experimental and you had to
> recompile perl to include a thread.pm module. I really don't want to do
> that since not very many people would then want to use my program. Also
> I read that using fork was a bad idea when trying to write portable code.
>
> So what would be the best way to be able to both accept and initiate
> network connections in perl? I want it to be portable. I assume some
> kind of concurrency would be needed but then again I havce only been
> using perl for a week.
>
> Thanks,
> Ryan
>
>

Reply via email to