msergeant has asked for the wisdom of the Perl Monks concerning the following question:
tie @$output, 'IPC::Shareable', $glue, { %options } || die "Tie failed +\n"; my $pm=new Parallel::ForkManager(50); foreach $keyword ( @keywords ) { $pm->start and next; $key= join('\+', split(/\ /, $keyword)); $remote = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => $port, ); unless ($remote) { die "cannot connect to http daemon on $host on +$port" } $remote->autoflush(1); print $remote "GET $prefix$key HTTP/1.0" . $BLANK; $count="0"; while ( <$remote> ) { if (/flist/i) { $count++; } } push (@$output, "$keyword,$count"); close $remote; $pm->finish(); } $pm->wait_all_children; # Write message to tmp file. $tempfile = basename($file); $tmpfile = "/tmp/$tempfile"; open(TMPFILE, ">$tmpfile") || die "Can't open $tmpfile for writing"; foreach $line ( @$output ) { $count++; print "$count\n"; print "$line\n"; print TMPFILE "$line\n"; } } close(TMPFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Out of memory error when using IPC::Shareable
by diotalevi (Canon) on Jan 09, 2003 at 05:52 UTC | |
by msergeant (Novice) on Jan 09, 2003 at 06:55 UTC | |
by diotalevi (Canon) on Jan 09, 2003 at 07:10 UTC | |
|
Re: Out of memory error when using IPC::Shareable
by shotgunefx (Parson) on Jan 09, 2003 at 08:21 UTC |