yes, when I write package at the top of the script I get the same error and when I run the pm file like a script I get the error. It appears to be related to the namespace of my package somehow breaking the creation of Lingua::StanfordCoreNLP subclasses.
| [reply] |
This is definitely related to Inline not Exporter which is what I originally thought. I see now that the subclasses are defined by Inline. So I need to understand how Inline exports into the calling class' namespace. | [reply] |
This is definitely related to Inline not Exporter
It's interesting that Inline::Java can have such an effect.
Try starting another perlmonks thread under a more appropriate title. That might flush out someone who has an understanding of Inline::Java (and perhaps even a solution for you.) Also, you could try a post to the Inline mailing list. I think the Inline::Java author is subscribed to that mailing list, but you could cc him just in case he's not. (You'll find an email address for him here).
Cheers, Rob
| [reply] |
Thanks for the recommendation. I think the issue is that Lingua::StanfordCoreNLP has the java code in the __DATA__ section of the PM file. My understanding is that the __DATA__ section is not read until runtime so the perl bindings to the java classes and methods can't happen until runtime. I was trying to create a Lingua::StanfordCoreNLP::Pipeline object in my package to store it as a package global. Doing this at that time, the Pipeline object is not defined yet.
My work around is to create the pipeline object at runtime and pass it along to the new method of my package.
I am also having trouble with using inline::java in a mod_perl environment -- there is information about this problem in the docs. I will pursue an Inline::Java thread if I run into more problems.
Thanks for your help!
| [reply] |