in reply to Re^4: An error in using XS
in thread An error in using XS

Oh, the error is coming from the XSUB. It looks like you're missing the MODULE directive there. Before _read_xs, add the line:

MODULE = Trialparser  PACKAGE = Trialparser

... and see if that fixes things. (It's an untested guess.)