in reply to Creating Filenames using variables

I kind of like the below, as it gets past the multiple dots in a file name (like test.doc.doc):
#!/usr/bin/perl -w use strict; my @files=qw(blah.doc.doc blah.doc.txt blah.doc); my ($d, $m, $y) = (localtime)[3 .. 5]; ++$m; $y += 1900; my $date = "$m$d$y"; foreach (@files){ s/(.*)(\..*)/$1_$date$2/; print "$_\n"; }