You have used single quoting for your command, so $exe will not be interpolated.
If you re-write line 16 as:
pid = $job->spawn("cmd", qq{cmd /C $exe}, );Then it should work
In reply to Re: Use variable in Win32::Job to execute command line
by chrestomanci
in thread Use variable in Win32::Job to execute command line
by ikkeniet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |