DaWolf has asked for the wisdom of the Perl Monks concerning the following question:

Greetings, fellow monks.

I'm programming a script that runs on my Win2K and I've created an icon to run it with a mouse click (my idea is to run on my computer startup).

Is there any chance run this script without the black DOS window?

One solution that I've found was to use PAR's pp to run it like an executable, but the size of my file increased a lot (from 17Kb to 1.78Mb!) and the amount of memory that the script uses also increased (from ~6Mb to ~9Mb)...

Any ideas?

Thanks in advance...

my ($author_nickname, $author_email) = ("DaWolf","erabbott\@terra.com.br") if ($author_name eq "Er Galvão Abbott");

Replies are listed 'Best First'.
Re: Running on DOS without the DOS box? -> wperl
by bart (Canon) on Oct 30, 2003 at 13:24 UTC
    wperl. If you have ActivePerl, then you'll already have it as wperl.exe on your harddisk, next to the original executable, perl.exe. You use it instead of the normal perl executable to run your script. Both are exactly the same executable, approximatly 5k in size, which loads the actual Perl interpreter as a DLL, and the difference between the two is one byte. See these docs for how it has been accomplished. ("exetype" is a Perl script that is also part of the distribution. You should have it as "exetype.pl" or as "exetype.bat".)
      That's a great tip, I never knew that. Several years ago I was asked to write a consoleless application on M$ Windoze to launch perl startup scripts. It would have been great to know about wperl back then. But I was not programming in Perl in those days.
      Thanks a lot, bart. Sometimes this linux/windows thing make me a bit confused and I forget to take a look at ASPN. :)

      my ($author_nickname, $author_email) = ("DaWolf","erabbott\@terra.com.br") if ($author_name eq "Er Galvão Abbott");
Re: Running on DOS without the DOS box?
by meetraz (Hermit) on Oct 30, 2003 at 20:34 UTC
    Here's a solution that doesn't require ActivePerl:

    use strict; use Win32::GUI; my $Window = Win32::GUI::GetPerlWindow(); sleep(5); Win32::GUI::Hide($Window); sleep(5); Win32::GUI::Show($Window);
    Pretty cool, huh? You can also obtain the handle to any other window on the desktop,
    and show/hide them at will.
      The other solution does not require ActivePerl. The wperl executable comes on all windows perls.