in reply to Matching a pattern in Regex

You need the /e switch in substitution.
Use smth like
s{<figr n="([^"]+)">(.*?)</figr>} {'<FIGIND NUM="'.$1.'" ID="FG.'.sprintf("%03d", $1).'">'.$2.'</FIGIND> +'}eg;
instead of the snippet you have shown.

     s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print