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

Slow down. What you're saying here doesn't make any sense, so I think you must be missing something larger. Remeber, mod_perl doesn't change anything about perl except the life cycle of your program, so this code has to match the first if condition. Something else (configuration? other code before this? the do_something function?) is preventing you from seeing it. Or maybe this is not the real code you're running, in which case we can't help you if you don't show us the real code.
  • Comment on Re^3: Weird mod_perl Regex '0' behavior.

Replies are listed 'Best First'.
Re^4: Weird mod_perl Regex '0' behavior.
by vansance (Initiate) on Sep 25, 2008 at 17:54 UTC
    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.
      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.