padawan_linuxero has asked for the wisdom of the Perl Monks concerning the following question:
as you can see I have 8 Entries but visible there suppose to be only 4 whether is RED o BLUE, but every time I run it is displaying 5!!!!, the first one is the one that display 2 entries and I have type it, copy it but still same problemsub Status_bancos { #Banamex########################################################## +######################### my $etiqueta_info1 = $upperframe->Label( -text => 'Santander :', )->pack(-side => 'left', -expand => 1); my $archivo1 = "santa1.txt"; open(DAT0, $archivo1) || die("Could not open file!"); my @stat0=<DAT0>; close(DAT0); foreach my $stat0(@stat0) { chomp ($stat0); my $banco0; my $stado0; ($banco0,$stado0)=split(/\|/,$stat0); if ($stado0 eq "ACTIVO"){ my $entry_info0 = $upperframe->Entry( -foreground => 'blue', -textvariable => \$stado0, -width => 20, )->pack(-side => 'left', -expand => 1); }else{ my $entry_info0 = $upperframe->Entry( -foreground => 'red', -textvariable => \$stado0, -width => 20, )->pack(-side => 'left', -expand => 1); } } my $label_info1 = $upperframe->Label( -text => 'Banamex :', )->pack(-side => 'left', -expand => 1); my $filename1 = "banamex.txt"; open(DAT1, $filename1) || die("Could not open file!"); my @stat1=<DAT1>; close(DAT1); foreach my $stat1(@stat1) { chomp ($stat1); my $banco1; my $stado1; ($banco1,$stado1)=split(/\|/,$stat1); if ($stado1 eq "ACTIVO"){ my $entry_info1 = $upperframe->Entry( -foreground => 'blue', -textvariable => \$stado1, -width => 20, )->pack(-side => 'left', -expand => 1); } else { my $entry_info1 = $upperframe->Entry( -foreground => 'red', -textvariable => \$stado1, -width => 20, )->pack(-side => 'left', -expand => 1); } } #HSBC################################################################# +################### my $label_info2 = $upperframe->Label( -text => 'HSBC :', )->pack(-side => 'left', -expand => 1); #---Extraccion de los datos de el archivo my $filename2 = "hsbc.txt"; open(DAT2, $filename2) || die ("Could not open file"); my @stathsbc=<DAT2>; close(DAT2); foreach my $statushsbc (@stathsbc) { chomp($statushsbc); my $banco2; my $stado2; ($banco2,$stado2)=split(/\|/,$statushsbc); if ($stado2 eq "ACTIVO"){ my $entry_info2 = $upperframe->Entry( -foreground => 'blue', -textvariable => \$stado2, -width => 20, )->pack(-side => 'left', -expand => 1); } else { my $entry_info2 = $upperframe->Entry( -foreground => 'red', -textvariable => \$stado2, -width => 20, )->pack(-side => 'left', -expand => 1); } } #Banorte############################################################## +############# my $label_info3 = $upperframe->Label( -text => 'Banorte :', )->pack(-side => 'left', -expand => 1); my $filename3 = "banorte.txt"; open(DAT3, $filename3) || die("Could not open file!"); my @stat3=<DAT3>; close(DAT3); foreach my $stat3(@stat3) { chomp ($stat3); my $banco3; my $stado3; ($banco3,$stado3)=split(/\|/,$stat3); if ($stado3 eq "ACTIVO"){ my $entry_info3 = $upperframe->Entry( -foreground => 'blue', -textvariable => \$stado3, -width => 20, )->pack(-side => 'left', -expand => 1); } else { my $entry_info3 = $upperframe->Entry( -foreground => 'red', -textvariable => \$stado3, -width => 20, )->pack(-side => 'left', -expand => 1); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A ghost Tk Entry in my program
by pc88mxer (Vicar) on May 10, 2008 at 17:36 UTC | |
by padawan_linuxero (Scribe) on May 10, 2008 at 17:47 UTC |