On Feb 10, 2:39 pm, [email protected] (Shawn H Corey) wrote:
> Jeff Peng wrote:
> > On Wed, Feb 10, 2010 at 2:40 AM, Ariel Casas <[email protected]> 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: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/