Here is some of the code:

#This is the main script #!/usr/bin/perl use strict; use Tk; use Cwd; use warnings; use product_search; use missing_articles; require Tk::DialogBox; require Tk::LabEntry; use Spreadsheet::WriteExcel; $tx = $mainFrame->Scrolled(qw/Text -font normal -width 73 -height 15 -wrap word -scrollbars e/ )->pack; tie *STDOUT, 'Tk::Text', $tx; #click Tk button and it calls a module passing the argument and the us +er input product_search::search($si1, $fullSearch);

The module runs through a list of products and finds matches, formats them for output, such as stripping product numbers if it has any in the product title, etc. As this process compares products, the print command is sending feedback to the user that should output in the scrolled text box above in the main perl script. At the moment, none of the stuff prints to the scrolled text box until the module has completed, instead of giving the user feedback as it runs the module

Code for module

#!/cygdrive/c/Perl/bin/perl package product_search; use strict; use strip_product_numbers; sub search { # Grab parameters that are passed to this module my ($si1, $fullSearch) = @_; # As it finds a product that matches, it processes it (strips +product number from title, etc) then should print it print "$product\n\n"; } 1;

So instead of printing all the products once the module finishes up, I want to print them as it processes. I am also printing status of the module and completion, so in case there is an error the user can give me a better idea where it is erring out, at this time, if the module fails, nothing is printed at all in the scrolled text box which won't help the user to tell me the problem and help me most closely identify it.

Thanks for all the help


In reply to Re^4: Dynamically Filling Text Box from Perl Tk by amdme127
in thread Dynamically Filling Text Box from Perl Tk by amdme127

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.