I don't want the *\windows\perl.exe window to open

H

hara

#!\c\perl\bin
use Tk;

my $mw = new MainWindow; # Main Window

my $frm_name = $mw -> Frame() -> pack();
my $lab = $frm_name -> Label(-text=>"Name:") -> pack();
my $ent = $frm_name -> Entry() -> pack();

my $but = $mw -> Button(-text=>"Push Me", -command =>\&push_button) ->
pack();
#Text Area
my $txt = $mw -> Text(-width=>50, -height=>30) -> pack();

MainLoop;

#This function will be executed when the button is pushed
sub push_button {
my $name = $ent -> get();
$txt -> insert('end',"Hello, $name.");
}

This is my script
Save the script as practice.pl
while running the script two windows open
1.the required TK window
2.The perl.exe window

I only want the TK window to open when I run this script.
Can it be possible.

Question-2
By doubl clicking any *.pl fils we can run that.
That means *.pl file are also acting as a *.exe file.
So is it required to make a *.pl file as *.exe to make a application.
 
D

Dave

hara said:
#!\c\perl\bin
use Tk;

my $mw = new MainWindow; # Main Window

my $frm_name = $mw -> Frame() -> pack();
my $lab = $frm_name -> Label(-text=>"Name:") -> pack();
my $ent = $frm_name -> Entry() -> pack();

my $but = $mw -> Button(-text=>"Push Me", -command =>\&push_button) ->
pack();
#Text Area
my $txt = $mw -> Text(-width=>50, -height=>30) -> pack();

MainLoop;

#This function will be executed when the button is pushed
sub push_button {
my $name = $ent -> get();
$txt -> insert('end',"Hello, $name.");
}

This is my script
Save the script as practice.pl
while running the script two windows open
1.the required TK window
2.The perl.exe window

I only want the TK window to open when I run this script.
Can it be possible.

Question-2
By doubl clicking any *.pl fils we can run that.
That means *.pl file are also acting as a *.exe file.
So is it required to make a *.pl file as *.exe to make a application.
Q1)
use Win32::Console;
Win32::Console::Free();

will get rid of the unwanted console window.

Q2)
You seem unclear about what is going on here. Double clicking on a .pl file
causes Windows to look up in the registry the file association and do the
default action which is probably called Open and defined as something like
'perl "%1"' on your system.

Are you clear as to what you mean by 'make an application'?
 
B

Brian Helterline

hara said:
#!\c\perl\bin
use Tk;

my $mw = new MainWindow; # Main Window

my $frm_name = $mw -> Frame() -> pack();
my $lab = $frm_name -> Label(-text=>"Name:") -> pack();
my $ent = $frm_name -> Entry() -> pack();

my $but = $mw -> Button(-text=>"Push Me", -command =>\&push_button) ->
pack();
#Text Area
my $txt = $mw -> Text(-width=>50, -height=>30) -> pack();

MainLoop;

#This function will be executed when the button is pushed
sub push_button {
my $name = $ent -> get();
$txt -> insert('end',"Hello, $name.");
}

This is my script
Save the script as practice.pl
while running the script two windows open
1.the required TK window
2.The perl.exe window

I only want the TK window to open when I run this script.
Can it be possible.

If you have activestate perl, use wperl.exe rather than perl.exe.
That is what it is for. You can do this from the command line:
C:> wperl practice.pl

or you can rename your file with a new extension (.wpl) and then
associate wperl.exe with that extension.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top