(Taking a break from tkil's excellent response, for now)

The script that I think could benefit from a reset function is 3400 line long. Castaway told me that if I documented it properly (forgot her exact words), I'd know what needs to be cleared and wouldn't need a global clear function, but I don't know if creating the necessary documentation would have been practical without anticipating the final form of the script.

It was originally intended to be much simpler script. I would have blamed a client for not giving me a proper description of his needs if this were a freelance job, but this was for myself, and I kept seeing potential for additional features, requiring many nested loops. Each new loop that I wrapped the original code in required resetting some variables, which I was able to handle, but then I added another loop, to make a single instance of the script run over and over for different clients. Once one job is done, it waits for another request. I could have tried figuring out what variables needed to be cleared, but I could easily have missed something.

Many of the replies in this thread are too critical without being specific, but if people saw my 3400 line script, it would be perfectly understandable to not be specific, and for the code not to be reviewed very carefully, or at all. It's too long and not written to be maintained by anyone but myself. It's closed source anyway.

The main reason for my posting VarStructor wasn't for others to analyze it. If people were able to and found something wrong, great. If not, it should be considered a tool, not something to grade for legibility or anything else. Yes, that's unusual for a module and for a Perl Monks post, but as far as I know, most software is closed source. Consider VarStructor a cross between closed source and a typical module if that helps.

For all those people who've told me to show them my script, remember that it is a web application that's run on my home computer, not yours. When vulnerabilities are announced, they are often exploited. Maybe it's necessary to announce vulnerabilities to those who are vulnerable, but in the case of my 3400 line script, you aren't vulnerable, and I want the same for myself. If a vulnerability was found by a hacker (yes, I'm using "hacker" as a bad word) while the web application was in production, that could be a problem for me. However, I have allowed numerous Monks to USE the application. Reviewing the code has its benefits for debugging, but consider this abstract from An Empirical Study of Operating Systems Errors (2001)

Abstract: We present a study of operating system errors found by automatic, static, compiler analysis applied to the Linux and OpenBSD kernels. Our approach differs from previous studies that consider errors found by manual inspection of logs, testing, and surveys because static analysis is applied uniformly to the entire kernel source, though our approach necessarily considers a less comprehensive variety of errors than previous studies.

In reply to Re: Re: Re: Re: Re: Re: 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.