fork process help needed

#!/usr/bin/perl

use strict;
use warnings;

my $count =0;
print localtime () . ": Hello from the parent ($$)!\n";
for ($count = 10; $count <= 100; $count = i+10) {
my $pid = fork;

die "Fork failed: $!" unless defined $pid;

unless ($pid) {
print localtime () . ": Hello from the child ($$)!\n";
exec "/opt/php/bin/php benchmark_mysql.php $count 150 >>
mysql_perf_cache_run$count.log"; # Some lon
g running process.
die "Exec failed: $!\n";
}
}

print localtime () . ": Goodbye from the parent ($$)!\n";
Naren [ Fr, 16 März 2007 01:56 ] [ ID #1660082 ]

Re: fork process help needed

>>>>> "N" == Naren <naren321 [at] gmail.com> writes:

N> my $count =0;
N> print localtime () . ": Hello from the parent ($$)!\n";
N> for ($count = 10; $count <= 100; $count = i+10) {
N> my $pid = fork;

N> die "Fork failed: $!" unless defined $pid;

N> unless ($pid) {
N> print localtime () . ": Hello from the child ($$)!\n";

why are you posting this to clp.modules? there are no module related
things in your code. repost it to c.l.p.misc or perl.beginners

uri

--
Uri Guttman ------ uri [at] stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
Uri Guttman [ Fr, 16 März 2007 02:17 ] [ ID #1660083 ]

Re: fork process help needed

Naren wrote:

Hi Naren

You should go to CPAN at http://search.cpan.org/
and search for Net::Server.

The tests supplied with the disto will give you a good set of examples
on which you can base you code.
Ron Savage [ Fr, 16 März 2007 10:09 ] [ ID #1660086 ]
Perl » comp.lang.perl.modules » fork process help needed

Vorheriges Thema: Recall::Template - new module proposal
Nächstes Thema: Re: How to replace a "/" in perl