Simple compiled regexp not working

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Kindly consider the following code which illustrates my question:

   use strict; use warnings;

   my $line = '08/29/2006 to 08/30/2006';
   my $date_rx = qr/\d/\d!};

   print "regexp  matches\n" if $line =~ m!\d/\d/\d!;
   print "date_rx matches\n" if $line =~ /$date_rx/;


The way I read perlop, both print statements should fire, as they
should be doing the exact same match. But I only see the first one.
grrr. This ought to be really simple.

David Filmer ( )

Site Timeline