in reply to Re^2: Replace MathML content using Twig
in thread Replace MathML content using Twig

Sure. Change the sub to:

sub subst { my ($twig, $value) = @_; $value->subs_text ('^s$', 'x'); $value->print (); }

I can thoroughly recommend the XML::Twig documentation by the way. It is long, but there are some really good examples.

True laziness is hard work