Nicola Worthington wrote:
> Hi,
> 
> I wonder if anyone can offer some help here?
> 
> I have a number of small webapps that run under Mason 1.33, Apache 2.2.2,
> mod_perl 2.0.2 and perl 5.8.8 on a RHEL4ES machine. The webserver and perl
> is all compiles from source.
> 
> I have an object $sprintObj that is defined as a global variable in the
> httpd.conf for Mason. I create this object as a second level autohandler
> in /sprint/autohandler, which the pages below it rely on, but other parent
> or sibling directories do not (Hence it's in that autohandler and not
> the parent one).
> 
> Sometimes it seems that the /sprint/autohandler never gets called in the
> code stack, so the $sprintObj object is never created, resulting in the
> error below where my page cannot use the object that it expects to exist:
> 
> error:        Can't call method "sprint" on an undefined value at
> /home/rrd/webroot/www/sprint/current_sprint.html line 2.
> context:
> 1:    <%method title>
> 2:    % my $sprint = $sprintObj->sprint || $sprintObj->last_sprint;
> 3:    Sprint <% $sprint->{sprint_id} %>
> 4:    </%method>
> 5:    <%args>
> 6:    $submit => 0
> ...
> code stack:   /home/rrd/webroot/www/sprint/current_sprint.html:2
> /home/rrd/webroot/www/autohandler:13
> /home/rrd/webroot/www/syshandler:9
> 
> Does anybody know why /home/rrd/webroot/www/sprint/autohandler sometimes
> dissapears from the code stack when it should live between
> /home/rrd/webroot/www/sprint/current_sprint.html and
> /home/rrd/webroot/www/autohandler?
> 
> Help!
> 
> Thanks in advance,
> Nicola
> 


First off, can I just say that you shouldn't reply to an existing thread
with a new problem. Although you might not see it in _your_ e-mail
client, others are using e-mail clients that will group e-mails into
threads, and your e-mail appears to be part of the "populate form
elements" thread. You need to compose a new e-mail to the list, instead
of replying to an existing one.


Your code that is causing an error, appears to be inside a method
definition inside your current_sprint.html file. It would appear, that
you're calling this method from your root autohandler, which would be
run before your /sprint/autohandler is run.

In this case, /sprint/autohandler isn't in the stack, because it hasn't
been called yet ($m->call_next in /autohandler will do that), but it
_is_ in the wrapping chain, so would have been called eventually, if
this error hadn't occured.

-Oli

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to