in reply to Starting a process and dying...

When you give a list to exec, it treats all of the function arguments as program arguments. Instead, pass it a string:
perl -e 'exec("nohup sleep 10 &")'
behaves how you'd expect.

See 370911 for some more Perlish approaches.

Replies are listed 'Best First'.
Re^2: Starting a process and dying...
by GaijinPunch (Pilgrim) on Dec 08, 2004 at 05:34 UTC
    You know, I was reading that earlier today... for some reason I thought I needed to pass it a list. Not sure why, but you know, it's been a long day, and weirder things have happened. Cheers for both the answers -- quite informative.
      If you don't pass it as a list, you're asking the shell to interpret the line, which means 1) You're running an extra program (which is probably no biggie), and 2) you need to be wary of injection attacks. Be sure to validate any text sent as arguments to the child.