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.
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.