Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Need to call 3rd party program and continue execution

by davido (Archbishop)
on Sep 23, 2012 at 08:02 UTC ( #995184=note: print w/replies, xml ) Need Help??

in reply to Need to call 3rd party program and continue execution

On Windows, you might try:

system 1, $command_which_will_not_block;

In a *nix environment, you could try:

system "$command_which_will_not_block &";

See also: perlipc#Complete Disassociation of Child from Parent, which for a Windows user is going to lead you to Win32::Process

The end result, if you go the Win32::Process route might look something like this:

use Win32::Process; my $curdir = 'C:/whatever'; my $appname = 'whatever.exe'; my $command_line = 'who_knows'; my $p_obj; Win32::Process::Create( $p_obj, $appname, $command_line, 0, CREATE_NEW_CONSOLE | DETACHED_PROCESS | NORMAL_PRIORITY_CLASS, $curdir ) or die "Couldn't spawn the process.\n";

...though I'm not certain on the choice of flags.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995184]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2017-06-23 10:33 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (541 votes). Check out past polls.