I'm not sure if you're referring to my 3000 line script with globals, or VarStructor, but I will admit that all the talk here about the value of lexicals has made me reluctant to recommend the use of globals to others, despite the fact that I can't find much substance to back up the talk when I investigate.

I'm still afraid that I could be stuck needing a variable that's scoped to some other block. Then I guess I'd have to package that block so I could call the variable. And if there was a properly used global in the block that I packaged (I assume people agree that a global is occasionally the best choice of variable), I'd have to change all instances of that global outside of the block to call the global in the packaged-variable way.

Scoping requires more blocks (as opposed to other ways of modularizing the code--I'm not against well defined sections), more packages, and more backtracking, editing and debugging if you change your mind. But everyone says it's the way to go, so being the agreeable person that I am, I won't argue.

But VarStructor still rules.


In reply to Re^5: VarStructor 1.0 by Wassercrats
in thread VarStructor 1.0 by Wassercrats

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.