I think the XS interface to the C function must pass a pointer to $text. In ExtractWords.xs you can see that the second argument to the function ew_words_list is a pointer to a character 'char *'
Comment on Re: Text::ExtractWords exhibits incomprehensible behavior?