Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Executing Systems Calls with Care

by Anonymous Monk
on Feb 15, 2005 at 06:50 UTC ( [id://431046]=note: print w/replies, xml ) Need Help??


in reply to Executing Systems Calls with Care

Isn't this exactly what alarm is designed for? perldoc -f alarm worked pretty well for me in the past.

Replies are listed 'Best First'.
Re^2: Executing Systems Calls with Care
by diotalevi (Canon) on Feb 15, 2005 at 21:10 UTC

    alarm() will not interrupt system calls in perl starting with 5.8. Since you are using a version older than that, you may be able to use it.

      But it does.

      $ perl5.8.6 -wle 'alarm 3; `cat /dev/zero`' Stops after 3 seconds.
        FWIW, on MacOS and AIX,

        perl -le 'alarm 3; system("sleep 100");'

        does kill perl, but it doesn't kill the sleep.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://431046]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-25 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found