http://www.perlmonks.org?node_id=1011252


in reply to Remove digits from a string and add timestamp to the result

This depends on the exact format of the filename. But possible the following example will give you an idea:

my $filename = "customer100"; my $timestamp= "02012013"; $filename =~ /(\w+)(\d+)/; # split filename into "custome +r" and "100" $filename = $1."_".$timestamp."_".$2;
HTH! Rata