Your problem is elsewhere. The . was not removed by that regexp. Or maybe you're not using strict (bad!) and really did forget to put the quotes around YYYYMMDD_something.xyz.
my $filename = 'YYYYMMDD_something.xyz';
my $DATE = '20061124';
$filename =~ s/YYYYMMDD/$DATE/i;
print($filename, "\n"); # 20061124_something.xyz
| [reply] [d/l] [select] |
...and yet another v. good reason to always use strict. I wouldn't normally mention it, but it seems a bit more insidious than the normal misspelt variable...
BTW OP, you've probably realised, but, in that context, the "." is interpreted as a string concatenation character.
Tom Melly, tom@tomandlu.co.uk
| [reply] |