U
usenet
Kindly consider the following code which illustrates my question:
#!/usr/bin/perl
use strict; use warnings;
my $line = '08/29/2006 to 08/30/2006';
my $date_rx = qr{m!\d{2}/\d{2}/\d{4}!};
print "regexp matches\n" if $line =~ m!\d{2}/\d{2}/\d{4}!;
print "date_rx matches\n" if $line =~ /$date_rx/;
__END__
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.
#!/usr/bin/perl
use strict; use warnings;
my $line = '08/29/2006 to 08/30/2006';
my $date_rx = qr{m!\d{2}/\d{2}/\d{4}!};
print "regexp matches\n" if $line =~ m!\d{2}/\d{2}/\d{4}!;
print "date_rx matches\n" if $line =~ /$date_rx/;
__END__
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.