Whoever wrote CGI.pm surely knew how my variables work because he used them, but he didn't think it was practical to make the user defined variables local.

I never said anything otherwise. In fact, I follow this same style myself: at the top of my programs, there are typically some global variables (my, but still treated as globally available) that control behavior of the rest of the program. I think this is healthy, and (among other things) promotes an eventual migration to using options or other more advanced ways of setting user preferences.

Everyone seems to be picking on the cosmetic things or the things they wouldn't need. Remember, along with the values, you get the variable names, which someone decided is useful since they're provided by Xref.

I addressed this obliquely before, but: there is an implicit assumption here on perlmonks that any code posted is open for criticism. In this case, we first criticized its higher-level "in the large" function: supporting a coding style that we find painful and distasteful. When you said that you were stuck with (or were going to stand by) that coding style, I took it upon myself to address some of the "in the small" deficiencies. Now you complain that we're nitpicking.

Which leaves us in the same position as has shown up a few times already: if you didn't want criticism, then explicitly say so. If you do post something that way, though, don't expect us to endorse it for enclusion into CPAN or even as a node that should survive here on perlmonks.

It's impossible for anyone to say that a script is a maintenance nightmare just because it uses all globals, no warnings and no strict.

No, but it is entirely possible to say that in one's experience, scripts that use strict, use warnings (or the older -w), and minimal globals are easier to maintain, modify, and debug. So, when confronted with a script written in a style which avoids all these programming aids (make no mistake, that is how the majority of monks perceive them), we are justified in guessing that this script will be more of a pain in the ass than most.

Forgot to mention another benefit of VarStructor. It could help you be sure that your variables are "my" variables.

Funny, but that's one of the things that use strict does for me.


In reply to Re^9: VarStructor 1.0 by tkil
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.