I am trying to re-exec my script after a delay. I expect that the code
below would go on re-execing indefinitely, however that does not
happen. It exits after one reexec. What should be done to make the
code re-exec forever?

$ cat exec.pl
#!/usr/bin/perl -w
use strict;
alarm(5);
$SIG{"ALRM"} = sub {
print "Reexecing\n";
exec($0,@ARGV);
};

print join(".",@ARGV);
sleep 12;
$ ./exec.pl 1 2 3 4
1.2.3.4Reexecing
1.2.3.4$
$

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to