Thoughts: this probably isn't a Tk specific issue. You are probably wiping $logline or $textline before the insert method is called. Which means your loop structure is suspect. Make sure your loop is actually the base level over which the process should be iterated.

I'm loathe to say the following because there is room in the world for personal style, but I am having a hard time reading the code and would love to be more helpful than I have been on this one. So here are some style tips that have helped me follow my own code and that of others more easily.

Not so many comments. If a reasonable Perl coder can't follow your code from the plain code then #comment-- or if you want to make a note. Use these sparingly like you would margin notes or footnotes. Major comment blocks work best in POD form, since this means never having to worry about the comment breaking over a line.

Single spacing for logical blocks, with extra space to break up groupings-- same as you would do for paragraphs. I've seen the C style for if-else, but prefer this:
if ( $condition ) { this_foo(); that_bar(); } else { #or "elsif ( $condition ) {" a_new_foo(); another_bar(); }
This keeps with the idea that else is a lead-in to a distinct BLOCK in your code.

I also tend to use something similar for Tk methods with more than two arguments.
$object->method( ARG1 => $this, ARG2 => $that, ARG3 => $else ) #if not packing put ";" here ->pack( ARGX => $whyzee );

In reply to Re: TK Problem (me again) by ichimunki
in thread TK Problem (me again) by locked_user mr_leisure

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.