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


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

Hi Sunil, If i understand your requirement correclty,

try this, Customer_."$timestmp"._100

Update:

$a=Customer100; $b=20130201; $a=~ /(.*?)(\d+)/; $a= $1."_".$b."_".$2; print $a;
Update1:
$a=~ s/(.*?)(\d+)/$1\_$b\_$2/;