http://www.perlmonks.org?node_id=573782


in reply to Getting the current perl interpreter while processing XS

Both xsubpp and ExtUtils::ParseXS pass the argument to INCLUDE directly to open() without preprocessing it. You could either preprocess your .xs file from Makefile.PL and fill in the path to the perl executable or you could probably use ExtUtils::ParseXS to write your own xsubpp which uses an overwritten open() function to do something special if it gets something like "$(PERLRUN) script.pl".

Cheers, Flo