in reply to Weird mod_perl Regex '0' behavior.

Try changing your regex to qr/^\s*(?:[0-9]|\*|\#)\s*$/ - don't capture.


Perl reduces RSI - it saves typing

Replies are listed 'Best First'.
Re^2: Weird mod_perl Regex '0' behavior.
by moritz (Cardinal) on Sep 25, 2008 at 07:00 UTC
    You do realize that the OP uses $1 in his code?

    The regex can be simplified in another way, though: qr/^\s*([0-9*#])\s*$/

      I suspect that the sample code posted by the OP is not his actual problem code. If the regex is actually in list context in the server side version of the code then he would see exactly the behaviour described. It seems to me that odd readonly effects as a function of run time input values in a mod_perl context only are much less likely than that the OP has "simplified" the code for us in some way that has removed an important part of the context.


      Perl reduces RSI - it saves typing