in reply to String replace with function
How can I do this? $str =~ s/\d+/&add($1)/gi; doesn't work
s/gi/ge - since i is case insensitive, e is eval ;-) And! capture to get $1:
$str =~ s/(\d+)/&add($1)/ge; [download]
...and &add() is soo perl4...