in reply to problem with substitute in regexp

thanks guys... also I found the solution with following. $str =~ s/f(\d+)/$replace{$1}/g;