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

Regards everyone, here is my situation, For the sake of information and for the sake of convenience, would there be any way I can disable the command line window from showing up when running a Perl/Tk application?

I have the notion (needs clarification though) that this command line window is part of the compiler triggering whenever a program is run, but If making a standalone Tk application be really independent from this window and that it doesn't have to show up every time I run the application is possible, it would be great that some generous monks show me where I can learn how to do this.

with all due reverence thanking you.

Update: I have used the wperl option since it seemed easier for the small task I got, the wperl.exe is in the same bin where perl.exe (the compiler) is, just save your program in .wpl instead of .pl and then run it using the wperl.exe., perlapp from ActiveState is certainly an option I'd use in the near future, Thanks Marshall.


Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.

Replies are listed 'Best First'.
Re: Tk and the command line window
by Anonymous Monk on Sep 04, 2009 at 03:54 UTC
Re: Tk and the command line window
by Marshall (Canon) on Sep 05, 2009 at 03:14 UTC
    Under Windows this command window can be annoying. One thing to think about is using the START command option which launches the Perl program with command window minimized to the Task Bar. Usually this is enough if you have experienced users who can follow directions.

    I use the ActiveState perlapp to generate standalone Tk based apps in .exe format and now I just turn their flag on that says "no command window".

    I recommend the "Perl Cookbook" by Tom Christiansen. His solution is:

    #!/usr/bin/perl -w use strict; use Win32; use Win32::Process; Win32::Process::Create ( $Win32::Process::Create::ProcessObj, 'C:/perl/bin/perl.exe', #Where Perl is located... 'perl myscript.pl', #the "real program" 0, #Don't inherit DETACHED_PROCESS, "." #current directory ) or die print_error(); sub print_error() { return Win32::FormatMessage ( Win32::GetLastError() ); }