On 03/08/2011 22:00, Brian F. Yulga wrote:
Jose Marquez wrote:
Hi there
Sure I am the newbiest of all Perl newbies in this group ....
Just have been reading some of the posts you all have sent since I
subscribe to this list What I'm trying to learn these days is how I
run a Perl script in background on Windows. Can anybody give a hint on
it?

As far as I know, the Windows cmd.exe environment doesn't let you
background a process the same way a unix shell does with '&'. However, I
have used "start" to achieve a similar effect when launching a script:

C:\> start /b perl script.pl

Type "start /?" at a cmd prompt to read about the "/B" switch. With this
switch, you'll still have the cmd.exe window open, but the prompt will
return immediately.

Also, I use this with Strawberry Perl; I don't know if ActiveState has
other tricks you can use.

It depends what you expect of a background program.

At a cmd prompt,

  start perl script.pl

will start the program executing in a new window of its own, and all IO
to stdout and from stdin is done through that window. Another cmd prompt
will appear straight away in the original window unless you use

  start /wait perl script.pl

Alternatively, as Brian says

  start /b perl script.pl

starts the program without opening a new window. Anything it sends to
stdout will appear in your current current window, but there is no way
to type anything to stdin.

Finally, if by 'background' you mean to run the program at low priority,
then

  start /low perl script.pl

is what you need.

Clearly these command qualifiers can be combined as necessary.

Rob

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to