Undefined subroutine error

2009-04-13 Thread Roberto C . Sánchez
So, I've been dealing with trying to figure out an "Undefined subroutine" error on one of my sites. At first I thought it was something to do with Apache::ASP, so I sent a message requesting help to that list: http://mail-archives.apache.org/mod_mbox/perl-asp/200811.mbox/thread

Re: Undefined subroutine error

2009-04-13 Thread Perrin Harkins
On Mon, Apr 13, 2009 at 8:21 PM, Roberto C. Sánchez wrote: > I've been dealing with trying to figure out an "Undefined subroutine" > error on one of my sites.  At first I thought it was something to do > with Apache::ASP, so I sent a message requesting help to

Re: Undefined subroutine error

2009-04-13 Thread Roberto C . Sánchez
On Mon, Apr 13, 2009 at 10:12:27PM -0400, Perrin Harkins wrote: > > In your Image.pm module, do you declare a package name? Do you export > get_image_name()? How do you load this module in your new Mason > setup? > The entire Example/Image.pm: --8<-->8-- package Exampl

Re: Undefined subroutine error

2009-04-13 Thread Perrin Harkins
On Mon, Apr 13, 2009 at 10:54 PM, Roberto C. Sánchez wrote: > The entire Example/Image.pm: I don't see you exporting get_image_data. Do you call it with a fully-qualified name then? e.g. Example::Image::get_image_data(). - Perrin

Re: Undefined subroutine error

2009-04-14 Thread Roberto C . Sánchez
On Mon, Apr 13, 2009 at 10:12:27PM -0400, Perrin Harkins wrote: > > Are they really identically configured? Are you sure there isn't a > difference in startup.pl or in MaxRequestsPerChild or something like > that? > OK, so the changes to include the mod_include and mod_disk_cache on the producti

Re: Undefined subroutine error

2009-04-14 Thread Perrin Harkins
On Tue, Apr 14, 2009 at 8:38 AM, Roberto C. Sánchez wrote: > OK, so the changes to include the mod_include and mod_disk_cache on the > production server did not do the trick.  The problem persists. I think it's all about the way you export your function, but you haven't answered my question about

Re: Undefined subroutine error

2009-04-14 Thread Roberto C . Sánchez
On Tue, Apr 14, 2009 at 12:36:25PM -0400, Perrin Harkins wrote: > On Tue, Apr 14, 2009 at 8:38 AM, Roberto C. Sánchez > wrote: > > OK, so the changes to include the mod_include and mod_disk_cache on the > > production server did not do the trick.  The problem persists. > > I think it's all about

Re: Undefined subroutine error

2009-04-14 Thread Perrin Harkins
On Tue, Apr 14, 2009 at 12:48 PM, Roberto C. Sánchez 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 t

Re: Undefined subroutine error

2009-04-14 Thread Roberto C . Sánchez
You're defining the sub in a package, so you either have to > export it or call it with the fully-qualified path, like you do in the > second case. > I have used the first syntax and have not noticed a different in the prevalence of the "Undefined subroutine" error betw

Re: Undefined subroutine error

2009-04-14 Thread Torsten Foertsch
On Tue 14 Apr 2009, Roberto C. Sánchez wrote: > I am currently using the latter call everywhere and it is still > generating the "Undefined subroutine" error. Would it be possible to post your module? Perhaps you forgot the "package" declaration? Torsten -- Need pro

Re: Undefined subroutine error

2009-04-14 Thread Perrin Harkins
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

Re: Undefined subroutine error

2009-04-14 Thread Roberto C . Sánchez
On Tue, Apr 14, 2009 at 07:48:49PM +0200, Torsten Foertsch wrote: > On Tue 14 Apr 2009, Roberto C. Sánchez wrote: > > I am currently using the latter call everywhere and it is still > > generating the "Undefined subroutine" error. > > Would it be possible to post

Re: Undefined subroutine error

2009-04-15 Thread Torsten Foertsch
On Wed 15 Apr 2009, Roberto C. Sánchez wrote: > > Would it be possible to post your module? Perhaps you forgot > > the "package" declaration? > > --8<-->8-- > > package Example::Image; Ok, then how about checking if your module is really loaded. Apache2::Status provides th

Re: Undefined subroutine error

2009-04-15 Thread Roberto C . Sánchez
On Wed, Apr 15, 2009 at 10:29:20AM +0200, Torsten Foertsch wrote: > > Ok, then how about checking if your module is really loaded. > Apache2::Status provides that or you could probably use this > PerlResponseHandler (untested): > > > SetHandler modperl > PerlResponseHandler "sub {

Re: Undefined subroutine error

2009-04-21 Thread Roberto C . Sánchez
On Tue, Apr 14, 2009 at 01:56:57PM -0400, Perrin Harkins wrote: > On Tue, Apr 14, 2009 at 1:34 PM, Roberto C. Sánchez > 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 > >> wrote: > >> > As far as loading the mod

Re: Undefined subroutine error

2009-04-21 Thread Perrin Harkins
On Tue, Apr 21, 2009 at 12:22 PM, Roberto C. Sánchez wrote: > So, on a lark I tried moving the "PerlModule Example::Image" from the > .htacess file to the virtual host configuration.  I then restarted > apache.  So far, it seems to have been working for several days.  In the > past, the problem wo

Re: Undefined subroutine error

2009-04-21 Thread Roberto C . Sánchez
On Tue, Apr 21, 2009 at 01:30:58PM -0400, Perrin Harkins wrote: > On Tue, Apr 21, 2009 at 12:22 PM, Roberto C. Sánchez > wrote: > > So, on a lark I tried moving the "PerlModule Example::Image" from the > > .htacess file to the virtual host configuration.  I then restarted > > apache.  So far, it s