:-) They are quite complex... the code within the if{} more than the regex itself. Unfortunately I can't do it exactly as you suggest because I need "if $a =~ /blah/ {loads of stuff which is all common to the two checks, and which I don't want to duplicate}", not just "$a =~ /blah/".
The...
Well it boils down to there being a variable which (by some earlier magic) is now '1' if we are to be case-insensitive, or 0 if case-sensitive.
Are the values of $1, $2 etc. available to you as the top level if set by a reg-ex from within a subroutine?
I've thought of a way of doing it...
if...
Hi,
Using Perl 5.6.1, I need a reg-ex which is sometimes case-sensitive, sometimes case-insensitive, according to something which happened earlier.
I've tried this:
$caseSensitiveCharacter = "i";
(or) $caseSensitiveCharacter = "";
[...then...]
if (...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.