drock has asked for the wisdom of the Perl Monks concerning the following question:
I have tried to match a pattern stored in a variable like so 08/14/04.
I cannot get it to pull on certain dates from a file. My file looks like 08/14/04 timestampe exxxxxmy $dm=08/14/04; open F, file while (<F>) { if ( $_ =~ /$dm/ ) { blah blah blah } if ( $_ =~ m/^\$dm/ ) if ( $_ =~ m/[$dm]/ )
20040819 Edit by broquaint: Changed title from 'reg exp'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: regex match with interpolated pattern
by hv (Prior) on Aug 18, 2004 at 15:23 UTC | |
Re: regex match with interpolated pattern
by davorg (Chancellor) on Aug 18, 2004 at 15:24 UTC | |
Re: regex match with interpolated pattern
by dsb (Chaplain) on Aug 18, 2004 at 15:24 UTC | |
by fletcher_the_dog (Friar) on Aug 18, 2004 at 19:49 UTC | |
by drock (Beadle) on Aug 18, 2004 at 15:45 UTC | |
by Roy Johnson (Monsignor) on Aug 18, 2004 at 16:21 UTC | |
by Zed_Lopez (Chaplain) on Aug 18, 2004 at 16:27 UTC |
Back to
Seekers of Perl Wisdom