To run win command with perl with no wait for process status and perl to continue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Selva123
    New Member
    • May 2010
    • 10

    To run win command with perl with no wait for process status and perl to continue

    Just trigger a command in window and no need to track its status such as failed or executed

    Hi, I have to execute a windows command with perl and my requirement is just to run the
    Command and no need to bother the status of the same which I will track the same with the same perl script after some time.

    Hence I do not need system() and backtick commands which will wait for the process to run and complete.
    When I use exec(), it is termining perl.
    What is the option to do the same?

    I heard that exec() with fork and waitpid() may handle the same but I am totally unaware of the same.
    Will someone help me with code snippet of the same with notepad.exe as example? or some
    other perl command to cater my purpose.
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    See: perldoc -q background

    Comment

    Working...