On Tue, 30 Jul 2002, Nigel Peck wrote:

> I having a strange problem with XSP, these are my results so far.
>
> O/S RedHat Linux 7.3
> Apache 1.3.26
> Mod_Perl 1.27
> AxKit 1.6
>
> I have a conditional which is based on the outcome of a subroutine like
> so:
>
> if ( ...... ) {
>   # foo
> } elsif (checkit()) {
>   # bar
> } else {
>   # foobar
> }
>
> The problem is the checkit() subroutine doesn't get called sometimes.
> If I call the page twice in a row, it doesn't get called the second
> time, if I call the page, then add as much as a single space anywhere in
> the page, and call it again it works, if I call the page, wait a minute
> or two, then call it again it works.

You have a closure. XSP is specifically designed to allow you to avoid
them - you just have to use it right. Subs must either be defined in other
packages, or defined in the top level <xsp:logic> section outside of your
result tags. See slide 14 on my AxKit tutorial at
http://axkit.org/docs/presentations/tpc2002/axkit.axp/axkit.pdf - and just
change the <xsp:structure> tag for <xsp:logic> and put your subs in there.

-- 
<!-- Matt -->
<:->Get a smart net</:->


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to