If I build a regular expression up out of previously compiled regexps, using the qr operator, why does the /i modifier not work on the final expression?

For instance, the following prints

   r1 match
   r3 match
   r4 match

but I would have expected r6 to match as well, since I used the /i modifier:

--------------
#!/usr/bin/perl

my $s = "This is a test";

my $r1 = qr/this/ix;
my $r2 = qr/this/x;
my $r3 = qr/$r1/x;
my $r4 = qr/$r1/ix;
my $r5 = qr/$r2/x;
my $r6 = qr/$r2/ix;

$s =~ $r1 && print "r1 match\n";
$s =~ $r2 && print "r2 match\n";
$s =~ $r3 && print "r3 match\n";
$s =~ $r4 && print "r4 match\n";
$s =~ $r5 && print "r5 match\n";
$s =~ $r6 && print "r6 match\n";

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to