Can not get following code work.
It works only when recive the first line.
Any ideas??
Regards.
Leandro.

#!/usr/bin/perl -slw use strict; use Regexp::Common qw/ net number /; use IO::Socket::INET::Daemon; use Parallel::ForkManager; use Net::Ping; use DBI; use YAML::Tiny; ###################################################################### +################## my $pm = Parallel::ForkManager->new(10); my $host = new IO::Socket::INET::Daemon( host => 'localhost', port => 1000, timeout => 20, callback => { data => \&data, }, ); $host->run; sub data{ my ($io, $host) = @_; my $line = $io->getline; return 0 unless $line; chomp($line); if($line =~ m/$RE{net}{IPv4}{-keep}/){ print "I got ip $1\n"; my $pid = $pm->start and next ; fork_work($1); $pm->finish; # Terminates the child process return !0; } print "not a good line:",$line; return !0; } $pm->wait_all_children; ###################################################################### +################## sub fork_work { print "working from new child!!!" }

In reply to IO::Socket::INET::Daemon and Parallel::ForkManager working togheter by leostereo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.