views:

1543

answers:

3

I have a Perl script that pops up a message box when its work is done. How can I run this in the background? I looked at Proc::Background but this requires launching a specific command. I'd like my code to run in the background with out spawning a new process if possible.

+6  A: 

One way is to run the program with wperl, the Windows GUI version, instead of perl.

Ronald Blaschke
Thanks, does exactly what I need since this is a simple program manually launched from the commandline.
Jared
A: 

IF you have Perl 5.x use fork. Fork is a built in keyword and supported across all platforms.

http://perldoc.perl.org/perlfork.html

Here is some sample code:

http://www.perlmonks.org/?node_id=663272

Good Luck!

Byron Whitlock
+3  A: 

Have you considered running it as a service? There is a perl script located here which will actually install it for you.

Alternatively, you could also try ExeService, a program which allows you to run Executables, Scripts, And commands as windows services.

For further information on what a windows service is: http://en.wikipedia.org/wiki/Windows_service

John T