Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

RE: Re: Background Process

by Intrepid (Curate)
on Jun 26, 2000 at 09:22 UTC ( [id://19806]=note: print w/replies, xml ) Need Help??


in reply to Re: Background Process
in thread Background Process

make it more portable this way:
use File::Spec; my $devnul = File::Spec->devnull(); print $reply_to_user; die "cannot fork: $!" unless defined ( my $pid = fork() ); if ( $pid ) { #this is the parent. exit; } else { #this is the child open STDOUT, ">$devnul" or die "Can't write to nowhere: $!"; open STDERR, ">$devnul" or die "Can't write to nowhere: $!"; sleep( 10 ); #do stuff }
This is a suggestion I have not tried, but BTW on WinNT the string value in $devnul is 'nul'.

Good Meditations,
soren andersen (Intrepid)

Q: What is the sound of several hundred Perler-dogs chasing cool code?
A: YAPC - YAPC - YAPC .. ! :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://19806]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2025-07-20 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.