On Saturday, October 26, 2002, at 07:28  PM, Mark Knipfer wrote:
On 10/26/02 1:25 PM, Trey Harris wrote:
Did you test this code snippet it? It won't work. You can't use a numeric comparison to test for stringwise equality. (Sorry to be nitpicky, but it matters here.)
No problem.  After I pasted the Perl code in my message, it was Perl
code that I copied to the clipboard and did not copy the latest code
revision I was working on that time.

I don't mind nitpicky, because errors do not run/work in Perl.
Oh, but sometimes they do. ;-)


One of the cardinal rules of defensive programming, at least in the
Unix world, is that you shouldn't check if you can do something--you
should just try to do it.  If it fails, *then* you check to see why.
Many, many potential security problems can be avoided that way.
I know that you all do not see this side of the computer, lucky for you
all, but I was working on the Perl code for a while.  Since I am not
fluent in Perl yet, I thought I would ask the mailing list.
It's a good question to ask, it's just that the right solution is probably "don't do it that way."

Trey's advice has another benefit - it's easier. Just as in life, it's easier to just try to do everything you have to do and wait until something goes wrong, than to try to check in advance every possible thing that could go wrong.

-Ken

Reply via email to