in reply to Re: WitchTest - A Tool For Determining If A Woman Is Guilty Of Witchcraft
in thread WitchTest - A Tool For Determining If A Woman Is Guilty Of Witchcraft
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.
|
|---|