On Tue, Apr 14, 2009 at 1:34 PM, Roberto C. Sánchez
<robe...@connexer.com> wrote:
> On Tue, Apr 14, 2009 at 01:21:09PM -0400, Perrin Harkins wrote:
>> On Tue, Apr 14, 2009 at 12:48 PM, Roberto C. Sánchez
>> <robe...@connexer.com> wrote:
>> > As far as loading the module, I have tried:
>> >
>> >  - "PerlModule Example::Image" in .htaccess
>> >  - "use Example::Image;" in the main HTML::Mason component
>>
>> Either of those should be ok.  If you decide to export the sub later,
>> you'd need to call it from Mason.
>>
> I'm not sure what you mean by this.

Well, read up about exporting and then it should make more sense.
Perl has namespaces, and when you export a sub you need to export it
to the namespace where you want to call it, which is Mason in this
case.

> I am currently using the latter call everywhere and it is still
> generating the "Undefined subroutine" error.

Then you must not be getting same error message that you posted to the
Apache::ASP list.  That was:
&Apache::ASP::Compiles::__ASP__srv_http_www_e_ample_com__x::get_image_data

This error message is what you get when you haven't defined that sub
in the current namespace and are calling it as get_image_data().  You
wouldn't get this message from calling
Example::Image::get_image_data().

- Perrin

Reply via email to