Wise monks

I have being trying out Tk as a front end for a program I am working have learn a lot these days, but know I came to a problem that I really try to fix but just did not find how, you see I have a list of 4 Entry widgets all of them are created from a text file like this :
bank1|ACTIVE bank2|NO ACTIVE bank3|ACTIVE
and the program is this one:
sub make_entry1 { my ($upframe,$labe2,$filename1) = @_; my $label_info4 = $upframe->Label( -text => 'Status :', )->pack(-side => 'left', -expand => 1); open(DAT1, $filename1) || die("Could not open file!"); my @stat1=<DAT1>; close(DAT1); foreach my $stat1(@stat1) { chomp ($stat1); my $operacion; my $stado1; ($operacion,$stado1)=split(/\|/,$stat1); my $label_display1 = $upframe->Label( -textvariable => \$operacion )->pack(-side => 'left', -expand => 1); if ($stado1 eq "ACTIVO"){ my $entry_info1 = $upframe->Entry( -foreground => 'blue', -textvariable => \$stado1, -width => 20, )->pack(-side => 'left'); #-expand => 1); } else { my $entry_info1 = $upframe->Entry( -foreground => 'red', -textvariable => \$stado1, -width => 20, )->pack(-side => 'left'); #-expand => 1); } } }
As you can see I choose to create averything from the textfile becasue we add or take out a bank, but if you run this program you will see that at the end, that it repeat itself again and again , so my question is how to stop the widget entry from duplicating itself?
Thank you wise monks!

In reply to Problem with duplicate Entry in One frame by padawan_linuxero

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.