At 16:27 -0700 5/3/1999, Vicki Brown wrote: > or (rephrased and simplified) Why can I use a variable inside the pattern > space but not outside the pattern space? > >I presume the answer has something to do with compile time vs run time >(i.e. the same sort of reasoning as to why a variable cannot be >interpolated inside the // of a tr/.../.../) but I don't know. It might be >a good question to ask on comp.lang.perl... Regardless of how you express it, the issue is just one of inconsistency. "Mastering Regular Expressions" covers this to some degree at 223, 231, 249 and it appears that the direct use of (?i) or whatever within the pattern space might provide some flexibility even if it tended to make the expression more illegible and is inconsistent with normal modifier usage. It also appears that during the initial processing phases, the scan for variable interpolation will only run from the first / to the second / and I would guess that where $case is "i", what is happening is that (?$case) becomes (?i) becomes //i, so the expression is rewritten in its entirety. What happens after that is not clear to me, but it seems like this adds an extra step that would be avoided if //$case was legal and it is odd that a modifier goes in the pattern space instead of the modifier space. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto://maccgi@bellsouth.net 770.565.8267 ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org