Michael Gargiullo wrote:
> I receive an error while running this script.  It goes an gets a list
> of 
> IP addresses that are on the network, then collects SNMP data from
> them. 
> ...
> When the script is run I see this output:
> 
> ...
> Can't locate object method "writer. via package "IO::Pipe::End" at
> ./fork-control-test.pl line 92.
> 00:E0:6F:14:AD:A2
> Can't locate object method "writer" via package "IO::Pipe::End" at
> ./fork-control-test.pl line 92.
> 
> Error Received:  Can't locate object method "writer" via package
> "IO::Pipe::End" at ./fork-control-test.pl line 91, <GEN0> line 1.
> 
> Line 91 of fork-control-test is
> >  $pipe->writer;
> 
> If the child process is something simple like print $data, it works
> great. 
> As soon as I put something in that requires some processing,
> filehandles, or network traffic, I get these errors. 
> 
> Does anyone see issues?  What does the error actually mean?

The error is saying that $pipe has been reblessed into an IO::Pipe::End,
which will be true if you've already called reader() or writer() on the
IO::Pipe object. I can't see anything obvious in your script that would
cause this however, unless the child { } block is somehow running off past
the end where you have the exit; statement.

Note that you really don't want to just pick children at random to fire off
messages to. You want to have some communication between the children and
the parents so the child can tell the parent when he's ready to receive the
next message. That way you keep all your children busy. This can be done by
using another pipe for the children to write their child number back to or
similar.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to