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!


In reply to Re^4: Calling an XSUB method from Catalyst by JNW
in thread Calling an XSUB method from Catalyst by JNW

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.