Thanks, callback functions looks useful and probably what I was looking for.
In reply to Re^2: How to call Encode::decode from Perl XS by mje in thread How to call Encode::decode from Perl XS by mje