develooper Front page | perl.perl5.porters | Postings from November 1999

Re: wait and extra argument

Thread Next
From:
M.J.T. Guy
Date:
November 10, 1999 08:27
Subject:
Re: wait and extra argument
Message ID:
E11laap-0002QA-00@taurus.cus.cam.ac.uk
Ed Peschko <Ed_Peschko@csgsystems.com> wrote
> I'd like to wait for a given process, but no longer than x number of seconds.
> So, why doesn't:
> 
> local($SIG{ALRM}) = sub { };
> alarm(100);
> my $pid = wait;
> 
> print STDERR "GOT $pid in a max of 100 secs intervening!!!!\n";

Because you haven't written it right.   Follow the instructions
in the FAQ, i.e. make the $SIG{ALRM} do a die() and wrap it all in
an eval {}.


Mike Guy

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About