in reply to Restarting counters in text
Also note that in the OP, as here, the "++" goes before the "$exmno", otherwise you get$exmno=0 unless s/<exm>/'<exm num="'.++$exmno.'">'/egs;
instead of<exm num="0">This is example 1
<exm num="1">This is example 1
I assume you want the numbers to match.
|
|---|