the C<ddd> isn't going to match the target string. But look at this
example:
- $x =~ /abc(?{print "Hi Mom!";})[d]dd/; # doesn't match,
- # but _does_ print
+ $x =~ /abc(?{print "Hi Mom!";})[dD]dd/; # doesn't match,
+ # but _does_ print
Hmm. What happened here? If you've been following along, you know that
-the above pattern should be effectively the same as the last one --
+the above pattern should be effectively (almost) the same as the last one --
enclosing the d in a character class isn't going to change what it
matches. So why does the first not print while the second one does?
C<?{}> construct). It's smart enough to realize that the string 'ddd'
doesn't occur in our target string before actually running the pattern
through. But in the second case, we've tricked it into thinking that our
-pattern is more complicated than it is. It takes a look, sees our
+pattern is more complicated. It takes a look, sees our
character class, and decides that it will have to actually run the
pattern to determine whether or not it matches, and in the process of
running it hits the print statement before it discovers that we don't