Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
The length is mostly down to documentation, as I'm sure you realise. Without the POD statements, it's more like 250 lines, and can be reduced still further by putting all assignments (especially in the Tk statements) on a single line. Isn't that always the way with documentation?

As far as the global variables are concerned, about half of them are bound to Tk widgets. I wanted to keep like with like, and declare them before I started declaring the widgets. On the same basis, I wanted all the global variables declared together. "All the rotten eggs in one basket". The code is laid out thuswise:
use
global variables
Tk
Bare block to load __DATA__
MainLoop
Subroutines

If this is bad style, I'd like to change it. But doing it this way fits my brain, so if there are reasons, I'd love to know them, whether by direct explanation or by reference. I can see that declaring a variable before it's needed can mean that it gets used accidentally. But given that there are only 8 of them, I felt that having them in a single block would mean that there was a reduced chance of double use, and an increased chance of seeing what each declaration was intended to achieve.

Thanks and regards,

John Davies

In reply to Re^2: RFC: spam reporting assistant by davies
in thread RFC: spam reporting assistant by davies

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 avoiding work at the Monastery: (2)
As of 2024-04-26 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found