Nishanth Ev schreef:

> Dr.Ruud:
>> nishanth ev:
>>> Dr.Ruud:
>>>> nishanth ev:

Man, what a mess you make of your entries.

Please don't top-post. Please cut the text that you don't 
react upon, especially sigs and tails.


>>>>> defined(my $pid = fork);
>>>> 
>>>> What does that line do? It tests $pid for
>>>> defined, but the return value is not used.
>>>> "or die $!" missing?
>>> 
>>> In case you want the die messages also...
>>> [...]
>>> defined(my $pid = fork)   or die "Can't fork: $!";
>>> setsid    or die "Can't start a new session: $!";
>>> Enjoy...!!!
>> 
>> I still don't understand what the line
>>>>> defined(my $pid = fork);
>> is supposed to do. What does it do better than just
>>    my $pid = fork;
> 
> It disassociates the process from the controlling
> terminal, or the login shell. Second, it removes the
> process from the process group that initiated the
> program. This ensures that the process is not a
> process group leader, which is required for setsid()
> to run successfully.

And all that in the single line "defined(my $pid = fork);"? 
That's certainly not what `perldoc -q daemon` says. 

-- 
Affijn, Ruud

"Gewoon is een tijger."

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to