Next System Programming in Perl 29

Signal Handling

        #!/usr/bin/perl
        my ($limit, $command, @args) = @ARGV;
        $SIG{ALARM} = 'DEFAULT';
        alarm $limit;
        exec $command, @args;
        die "Couldn't run '$command': $!";
        stopafter 30 command arg arg arg...


Next Copyright © 2003 M. J. Dominus