Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Do you know where your variables are?
 
PerlMonks  

Re^7: System Function...script does not move until process ends.

by RazorbladeBidet (Friar)
on Apr 06, 2005 at 14:31 UTC ( [id://445392]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^6: System Function...script does not move until process ends.
in thread System Function...script does not move until process ends.

What you're missing is that exec abandons the process after it starts it. So it will only wait until the child dies, which should be right after it starts the database :)

I had reservations about this when I wrote it, and I confirmed them:
#!/usr/bin/perl -w use strict; use POSIX ":sys_wait_h"; defined (my $pid = fork()) or die "D'oh"; if ( $pid ) { print "$$ gonna wait...\n"; my $kid; do { $kid = waitpid $pid, WNOHANG; } until ( $kid > 0 ); print "Ok, done waiting\n"; } else { exec 'sleep 10; echo "Done sleeping\n"'; }
What I had thought it would do was to start the execution of the command and then bail. Well.. it didn't. It waited.

Now go get that dinner.

No dinner for you :)
--------------
"But what of all those sweet words you spoke in private?"
"Oh that's just what we call pillow talk, baby, that's all."

Replies are listed 'Best First'.
Re^8: System Function...script does not move until process ends.
by polettix (Vicar) on Apr 07, 2005 at 04:48 UTC
    Too late, I had a wonderful dinner yesterday, based on hand-made pasta with shrimps and then grilled swordfish. Just to reward myself of being right ;-)

    Flavio (perl -e "print(scalar(reverse('ti.xittelop@oivalf')))")

    Don't fool yourself.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://445392]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.