in reply to Re^3: Weird mod_perl Regex '0' behavior.
in thread Weird mod_perl Regex '0' behavior.

Perrin, you are right. I got clogged down in the if that I was showing you that I didn't consider the calling method.

There was nothing wrong with the code that I put in before, the problem was that the method containing that code, is_input_valid, was called within a conditional that didn't check if it was defined, and eval'd '0' as false. ie.
unless ( is_input_valid() ) { report_bad_input(); }
And the proper code should have been,
unless ( defined is_input_valid() ) { report_bad_input(); }
Very careless of me. I apologize. Thank you for the help.

Replies are listed 'Best First'.
Re^5: Weird mod_perl Regex '0' behavior.
by perrin (Chancellor) on Sep 25, 2008 at 18:15 UTC
    Good. You know, is_bad_input sounds like it's just going to return 1 or 0, so if you intend to have it return the input I'd name it something like clean_input.