Paul Lussier wrote:
>
> In a message dated: Mon, 14 Feb 2000 03:18:25 EST
> Adam Wendt said:
>
> >Whats the best way in perl to run an external command and if while executing
> >the command I hit ctrl + c it will just cancle the external command and contin
> >ue on with the script instead of bailing out of everything?
The system command is your best bet. In fact if you use the system() command
then you don't have to do any special handling for the signal. When you press
^C it will be passed to the child, and not caught by the parent. ie:
perl -e 'system("sleep 100"); print "Ctrl-C killed the child not me!\n"'
However, if you are using pipes or backticks you will have to get more
tricky, and modify the %SIG hash (specificaly $SIG{INT}) to handle the
signal and interupt the child.
-Matt
--
Matthew W. Herbert x75764
Spectrum Advanced Applications
http://www.aprisma.com/
mailto:[EMAIL PROTECTED]
**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************