On Feb 10, 2:39 pm, shawnhco...@gmail.com (Shawn H Corey) wrote:
> Jeff Peng wrote:
> > On Wed, Feb 10, 2010 at 2:40 AM, Ariel Casas <ariel.ca...@gmail.com> wrote:
>
> >> My question is; how do I keep my perl script from dying if my shell
> >> window accidentally closes while my perl script is paused at the
> >> system function portion of my script?
>
> > Make a daemon process for running in the script, or use nohup:
>
> > nohup perl a.pl
>
>
> You can do the same thing inside Perl with %SIG:
>
>   $SIG{HUP} = 'IGNORE';

I'd think  'nohup perl a.pl' would be a smidge  safer  though since
the script is vulnerabe during startup/loading before the 'IGNORE'
is seen.  Of course, you could mitigate risk by setting the 'IGNORE'
inside a BEGIN{}.

--
Charles DeRykus


--
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