Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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 mr_leisure

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-23 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found