Date: 10 Sep 2001 23:50:58 GMT From: damian@qimr.edu.au (Damian James) Subject: Re: start a script when a process exits Message-Id: Luke Vanderfluit chose Tue, 11 Sep 2001 09:07:57 +0930 to say this: >... >I am running linux. I have a prgram called wvdial that connects me to >the internet. >when it exits, I want to run a script (perl or other) that I have >written. > >How do I get the exit of a process to trigger another process to run? >Can it be done in perl? > Wrap your call to the program in the script with a system() call, which waits for the former to complete before going on: #!/path/to/perl -w use strict; system('wvdial'); ### might want to check the return status, too # # do other stuff here # __END__ Cheers, Damian -- @:=grep!(m!$/|#!..$|),split//,;@;=0..$#:;while($:=@;){$;=rand $:--,@;[$;,$:]=@;[$:,$;]while$:;push@|,shift@;if$;[0]==@|;select$,, $,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/} __END__ Just another Perl Hacker, ### rev 3.3 -- stupidectomy performed :-)