Red_Dragon has asked for the wisdom of the Perl Monks concerning the following question:

All knowing Monks,

What must I code to start a Perl script from within a Perl script(if such a thing is possible) that will be totally independent of the launching script. This is to run on a Win2000Pro system running Perl 5.8. Thank you for any consideration.

R_D

Replies are listed 'Best First'.
Re: One Script From Another
by tcf22 (Priest) on Aug 26, 2003 at 16:36 UTC
    Win32::Process using the DETACHED_PROCESS flag should do what you want.
    Win32::Process::Create($ProcessObj, "c:\\perl\\bin\\perl.exe", "perl script.pl", 0, DETACHED_PROCESS, ".")|| die Win32::FormatMessage(Win32::GetLastError());
      The code snippet worked beautifully. Many thanks, your investment is not wasted.
Re: One Script From Another
by CombatSquirrel (Hermit) on Aug 26, 2003 at 15:56 UTC
    Have a look at this thread, started about 10 mins before you posted yours ;-)
    Cheers,
    CombatSquirrel.
    Entropy is the tendency of everything going to hell.
      Thank you CombatSquirrel
Re: One Script From Another
by dragonchild (Archbishop) on Aug 26, 2003 at 15:51 UTC
    You want to detach a process from another. Look up forking, detaching, and parent-child relationships. Good luck!

    ------
    We are the carpenters and bricklayers of the Information Age.

    The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

      Thank you for taking the time. R_D
Re: One Script From Another
by NetWallah (Canon) on Aug 26, 2003 at 19:22 UTC
    Here is some code I wrote years ago to do just that.
    This is working Win32 code.
    Look at sub Process_this_Device() for relevant code.
      Interesting piece of work, I am studying it with Perl manuals in hand. Thank you it has given me some much needed insights. R_D