in reply to Proc::Background does not take file path with spaces
Looking inside the Win32 component of Proc::Background it does some pretty dubious manipulations with the program component of its arg(s), including if, -- after it has done some other incomprehensible manipulations -- the length of the command argument is 0, then it wraps that zero length arg in quotes:
if (length($arg) == 0 or $arg =~ /\s/) { $arg = "\"$arg\""; }
None of which bodes well for success.
If all you need is to start a process in the background, a simple:
my $pid = system 1, 'c:/program Files (x86)/vs.exe';
Does the job.
if( kill $pid, 0 ) { ... will tell you if it is still running.
kill $pid, 3; will terminate it.
waitpid $pid,0; my $retcode = $?; will get the return code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Proc::Background does not take file path with spaces
by SuicideJunkie (Vicar) on Apr 27, 2012 at 13:34 UTC | |
by BrowserUk (Patriarch) on Apr 27, 2012 at 14:11 UTC | |
by dinasour (Novice) on Apr 28, 2012 at 00:08 UTC |