perl-asp mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Helmut <hel...@hzlabs.com>
Subject Re: XML - problem with variable scoping
Date Mon, 03 Nov 2003 07:10:11 GMT
Hi TIA,

correction:

 <my:display variable="$Session->{'loaded1'}"/> or
 <my:display variable="<%=$Session->{'loaded1'}%>"/>

seem not to work, because ASP does not recognize it as variables.
You could use

<% my $loaded1 = $Session->{'loaded1'}; %>
<my:display variable="$loaded1"/>

but this would be the same, as if you would use

[..]
my $loaded1;

sub my::load_all
{  [..]
   $loaded1 = 'something';
   [..]
}
[..]

without any session variables.
This works for me, even with "UseStrict 1".
But, of course, you must declare $loaded1 OUTSIDE the subroutines.


Helmut


--On Sunday, November 02, 2003 19:30:52 +0000 luciflatum 
<llucif@hotmail.com> wrote:

> Hi all!
> I am using the XML engine to embed dynamic content into an HTML page
> via Apache::ASP. What I need is a simple way to retain the values of
> the variables between different XML tags within the same page.
>
> Something like this:
>
> ---TOP OF PAGE---
> <my:load_all/>
>
> <my:display variable="loaded1"/>
>
> <my:unload_all/>
> ---END OF PAGE---
>
> This layout triggers a problem: if I use the strict pragma I can't use
> the same variables (each my:: function is isolated in scope); if I
> declare a global variable in my::load_all there are all the usual
> conflicts between different sessions.
>
> Does anybody know how to fix this?
>
> TIA
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
> For additional commands, e-mail: asp-help@perl.apache.org
>





---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Mime
View raw message