gammaman64
Programmer
Iam trying to write a function with a gui interface that allows the user to enter a file, and the system will check that file, and return the result. After they enter the file, how do I capture what they have entered, to be checked by the system.
sub check{
my $check = MainWindow->new(
-background=>'red',
-title=>'Type the file you wish to check');
my $entry = $check->Entry(
-textvariable=>\ my $txt);
my $entry_ok = $check->Button(
-text=>'OK'
-command=>);
$entry->pack();
$entry_ok->pack();
foreach my $file (@ARGV){
print ("Checking $file:");
if (-f $file){
print ("The file $file is:");
print ("readable")if(-r $file);
print ("writable")if(-w $file);
print ("executable") if (-x $file);
}
elsif (-d $file){
print ("$file is a directory");
while ($file)
{
my $count +=1;
}
sub check{
my $check = MainWindow->new(
-background=>'red',
-title=>'Type the file you wish to check');
my $entry = $check->Entry(
-textvariable=>\ my $txt);
my $entry_ok = $check->Button(
-text=>'OK'
-command=>);
$entry->pack();
$entry_ok->pack();
foreach my $file (@ARGV){
print ("Checking $file:");
if (-f $file){
print ("The file $file is:");
print ("readable")if(-r $file);
print ("writable")if(-w $file);
print ("executable") if (-x $file);
}
elsif (-d $file){
print ("$file is a directory");
while ($file)
{
my $count +=1;
}