in reply to regex code embedding problem?

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^>