Mark Seger wrote:
>
> I'm trying to get some ASP code that currently runs on IIS to runs on
> apache as well. Turns out it's almost a no brainer which means a job
> well done for the apache asp team. However, I have bumped into an issue
That's good to hear. Note that some features get turned on with the
CollectionItem setting to activate certain collection type behaviors.
This has facilitated others port before.
> around the $Request->ServerVariables() in that it would appear a lot of
> the 'standard' ones are not supported. Rather than try to walk though
> each manually I would have at least thought that ALL_HTTP would have
> been available to me but it's not. QUERY_STRING certainly works but I
> can't find many others that do.
>
ServerVariables are web server dependent environment availables,
equivalent to %ENV in Apache::ASP. So what Apache sets seems to
differ greatly from what IIS sets.
What you can do to make a compatible environment is:
# in global.asa
sub Script_OnStart {
my $all_http = 'something';
$Request->ServerVariables('ALL_HTTP', $all_http);
}
This will set up for you the ALL_HTTP variable to your specs
for all ASP scripts, and you can further customize your environment
as you see fit.
Once you have figured out all the environment variables that are
missing and how to construct them to make things look like IIS,
then we might create a PerlSetVar ServerCompat IIS setting that
sets these up for you without having to use Script_OnStart event.
> As a nit, it took me some time to figure out I had to explicity 'my' all
> my variables if I didn't want them to retain their values between
> calls. It was also puzzling to find a varible lose its value after
> some unclear amount of time. I spent a fair amount of time trying to
> figure out how to cause a variable to regain it's 'undef' state by
> playing with various timers, session saving parameters, etc. all with no
> luck until I stumbled on using 'my' at the start of my asp script for
If you had "use strict;" turned on, these my-less variables would have
created compile time errors. This is a common mod_perl issue. In
Apache::ASP, this is facilitated by setting
PerlSetVar UseStrict 1
which makes strict all scripts,includes, & global.asa I believe.
I have considered having this setting turned on by default, but
haven't figured a good way to do this, and keep backwards
compatibility.
> each variable. I know 'strict' and/or other better coding practices
> would have saved me the grief. However, there may also be some value in
> putting something into the FAQ or other location. One might word such as
> FAQ as
>
> "Why do my script variables retain their previous settings when a script
> is run multiple times in a row and lose them if I wait 10-15 seconds or
> so, as can be observed in the following script:
>
> <HTML>
> <BODY>
> $counter++;
> $Response->write("<BR>Counter: $counter");
> </BODY>
> <?HTML>
>
I'll add a section like this to the FAQ.
Thanks.
Josh
_________________________________________________________________
Joshua Chamas Chamas Enterprises Inc.
NodeWorks Founder Huntington Beach, CA USA
http://www.nodeworks.com 1-714-625-4051
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]