1/ Always use strictures (use strict; use warnings;).
Actually, in this case, adding warnings would make the program spit out a warning if run without arguments. But it's arguable that the program is actually doing the right thing. It's a sign of a newbie to assume that slapping 'use strict' and/or 'use warnings' on a program magically increases the quality of the program - wearing seatbelts doesn't make you a better driver either. And note that slapping 'use strict' on this correct program actually prevents it from compiling. Doesn't seem like an improvement to me.
2/ $suspectedWitch is assigned a value which is never used.
Maybe you see a different program than I do, but I see $suspectedWitch being used in the print statements.
6/ No test is made to determine that a name has actually been passed on the command line.
In my universe if ($ARGV[0]) won't be true if there's nothing on the command line.
7/ Dates are better given using one of the ISO time/date formats to avoid confusion.
Not of course in the case of the Salem witch hunt. The ISO standard is a standard about the Gregorian calendar. But the colonies were still on a Julian calendar by 1692.

And after 7 points, you still fail to spot the non lexical variables.


In reply to Re^2: WitchTest - A Tool For Determining If A Woman Is Guilty Of Witchcraft by JavaFan
in thread WitchTest - A Tool For Determining If A Woman Is Guilty Of Witchcraft by bpoag

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.