in reply to Re^3: Calling an XSUB method from Catalyst
in thread Calling an XSUB method from Catalyst
Thank you for your reply.
Both use and require seem to find the package, but the method cannot be called. Therefore, it is entirely possible that I am in the wrong name-space: although I specify the module explicitly. I have engineered a relevant snippet for perusal:
package Catalyst::View::Foo;
use base 'Catalyst::View';
use Bar qw/my_method/;
use Data::Dumper;
###
# Method of interest
#
sub process {
eval {
Bar::my_method(1,2,3); # results in ``Undefined subroutine &Bar::my_method''
}
print Dumper $!, $?, $@; # very lazy error-finder
}
1;
I suppose it could be that it doesn't like calling non-OO perl (well, technically perl and xsub) ... although print Dumper works so I'm not sure that this analysis is correct.
I'm really stumped on this on this. What Jettero posted earlier prompted me to check whether %ENV was being truncated in some way by catalyst, but catalyst %ENV appears to contain only additional information to when checked against the command-line perl %ENV (Thanks for the prompt, Jettero :) ).
I'm still hoping that I've done something really silly and obvious :)
Rather than trusting that I have got the correct options to perl, I have now installed it into my machine properly, in the hope that it would have resolved any path issues not finding the .so. Unfortunately, there has been no change in outcome, although it can be called correctly from the command-line script anywhere in my directory tree, which has reduced my test typing somewhat :).
Thanks again for your time!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Calling an XSUB method from Catalyst
by JNW (Novice) on Jun 03, 2009 at 13:33 UTC | |
by Anonymous Monk on Jun 03, 2009 at 15:46 UTC |