>>>>> "GL" == Greg London <[email protected]> writes:
GL> CRAP!
GL> #!/usr/bin/perl
GL> use warnings;
GL> use strict;
GL> $SIG{ALRM} = sub { die "timeout\n" };
that only exits the eval block. you need to kill the process. you can't
do that without the pid and backticks doesn't get you the pid. use the
open pipe method and you get the pid.
GL> eval {
GL> alarm(10);
GL> my $oscmd="echo \"hello\"; sleep 30000; echo \"world\";";
GL> `$oscmd`;
GL> alarm(0);
GL> };
GL> print "\ps -ef\n";
that doesn't do anything but print that string.
uri
--
Uri Guttman -- uri AT perlhunter DOT com --- http://www.perlhunter.com --
------------ Perl Developer Recruiting and Placement Services -------------
----- Perl Code Review, Architecture, Development, Training, Support -------
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm