My best guess is that when your regexp gets compiled -- the first time it is run -- the "first" %date gets compiled in. Perl thinks that since the compiled regexp hasn't changed, it can just rerun the regexp, but instead it populates the wrong %date.
Put the $file_name =~ ... inside an eval "" and it'll do what you expect it to do.
--
LP^>
In reply to Re: regex code embedding problem?
by TilRMan
in thread regex code embedding problem?
by perlguy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |