in reply to Real-time socket data processing

Maybe I'm misunderstanding something, but why not simply put the processing in the loop?  (together with some condition that detects when a 'packet' is complete)

Something like this:

while (defined(my $line = <$NA_Conn>)) { $input.=$line; if ($input =~ / ... /) { process($input); $input = ''; } }

Replies are listed 'Best First'.
Re^2: Real-time socket data processing
by psyk0tic (Novice) on Jun 24, 2010 at 17:48 UTC

    Thanks for the reply almut,

    Humm... I guess we're gonna for the ''simpler and efective way'' here ;)

    You're not misunderstanding nothing, it was me who was not seeing the 'almost' obvious. I will give it a try.

    Thanks again! :)