props has asked for the wisdom of the Perl Monks concerning the following question:
MainLoop; ##**********************************************8 #when i click the button i window appears then close it #program exits sub openEksoda_button { do "eksoda.pl"; } sub openEsoda_button { #************************** #Same case here do "esoda.pl"; } sub Eksoda_Statistika_button { my @totalEksoda = (); my $eksodasum = 0; my $clearedeksodaValue=0; chdir "/home/props/delice/eksoda" or die "didn't make to eksoda folde +r\n"; foreach my $file (glob '*.txt') { open IN, $file; while (<IN>) { if ($_ =~ m/(Eksoda.*Total:)(.*\d)/) { $clearedeksodaValue =$2; push(@totalEksoda,$clearedeksodaValue); } #if } #end while } #end outer foreach foreach (@totalEksoda){ $eksodasum+= $_; } #end inner foreach chomp $eksodasum; my $displayeksodasum ='Ta eksoda einai:' ." $eksodasum"; #************************************************ #this works nicely since gets me back to previous interface without ex +iting the program my $DialogRef = $mw->Dialog( -text =>$displayeksodasum ); $esodaSTmb = $DialogRef->Show; } #end sub sub Esoda_Statistika_button { my @totalEsoda = (); my $esodasum = 0; my $clearedesodaValue=0; chdir "/home/props/delice/esoda" or die "didn't make to esoda folder\ +n"; foreach my $file (glob '*.txt') { open IN, $file; while (<IN>) { if ($_ =~ m/(Esoda.*Total:)(.*\d)/) { $clearedesodaValue =$2; push(@totalEsoda,$clearedesodaValue); } #if } #end while } #end outer foreach foreach (@totalEsoda){ $esodasum+= $_; } #end inner foreach chomp $esodasum; my $displaysum ='Ta esoda einai:' ." $esodasum"; #********************************************************* #here the same as expected my $DialogRef = $mw->Dialog( -text =>$displaysum ); $esodaSTmb = $DialogRef->Show; } #end sub
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk-Toplevel related
by jdporter (Paladin) on Oct 10, 2007 at 20:56 UTC | |
|
Re: Tk-Toplevel related
by shmem (Chancellor) on Oct 10, 2007 at 21:09 UTC | |
by props (Hermit) on Oct 11, 2007 at 06:48 UTC | |
|
Re: Tk-Toplevel related
by zentara (Cardinal) on Oct 11, 2007 at 13:03 UTC | |
by props (Hermit) on Oct 13, 2007 at 15:50 UTC |