13 is(ref $rx, "Regexp", "qr// blessed into `Regexp' by default");
16 # Make sure /$qr/ doesn’t clobber match vars before the match (bug 70764).
23 $foo += () = ($a =~ /$rx/g);
24 $output .= "$foo\n"; # correct
27 for ($foo += ($a =~ /o/); $' && ($' =~ /o/) && ($foo++) ; ) { ; }
28 $output .= "1: $foo\n"; # No error
31 for ($foo += ($a =~ /$rx/); $' && ($' =~ /$rx/) && ($foo++) ; ) { ; }
32 $output .= "2: $foo\n"; # initialization warning, incorrect results
34 is $output, "5\n1: 5\n2: 5\n", '$a_match_var =~ /$qr/';
42 $foo += () = ($a =~ /$rx/g);
43 $output .= "$foo\n"; # correct
46 for ($foo += ($a =~ /o/); $' && /o/ && ($foo++) ; ) { ; }
47 $output .= "1: $foo\n"; # No error
50 for ($foo += ($a =~ /$rx/); $' && /$rx/ && ($foo++) ; ) { ; }
51 $output .= "2: $foo\n"; # initialization warning, incorrect results
53 is $output, "5\n1: 5\n2: 5\n", '/$qr/ with my $_ aliased to a match var';
61 $foo += () = ($a =~ /$rx/g);
62 $output .= "$foo\n"; # correct
65 for ($foo += ($a =~ /o/); $' && /o/ && ($foo++) ; ) { ; }
66 $output .= "1: $foo\n"; # No error
69 for ($foo += ($a =~ /$rx/); $' && /$rx/ && ($foo++) ; ) { ; }
70 $output .= "2: $foo\n"; # initialization warning, incorrect results
72 is $output, "5\n1: 5\n2: 5\n", q|/$qr/ with $'_ aliased to a match var|;
75 # Make sure /$qr/ calls get-magic on its LHS (bug ~~~~~).
78 sub qrBug::TIESCALAR{bless[], 'qrBug'}
79 sub qrBug::FETCH { $scratch .= "[fetching]"; 'glat' }
80 tie my $flile, "qrBug";
82 is $scratch, "[fetching]", '/$qr/ with magical LHS';