in reply to open-coding a system() operation
I usually use if/elsif/else when forking:
Which is the same thing, but in my opinion a little easier to read.if (my $pid = fork) { # Parent local $SIG{INT} = 'IGNORE'; local $SIG{QUIT} = 'IGNORE'; waitpid($pid, 0); } elsif (defined $pid) { # Child exec 'date'; die 'date not found' } else { die "Can't fork: $!"; }
Why do you ignore those signals? I know near to nothing about signals and would like to learn (have only used HUP to reload configuration files, and Perl's __DIE__/__WARN__).
Juerd
- http://juerd.nl/
- spamcollector_perlmonks@juerd.nl (do not use).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Re: open-coding a system() operation
by merlyn (Sage) on Apr 22, 2003 at 02:40 UTC | |
|
Re: Re: open-coding a system() operation
by dug (Chaplain) on Apr 22, 2003 at 04:14 UTC |