$t =~ s/$somePattern/@{[ some_function($1) ]}/g;