> > > Not that if you are using the same sub routine name,
> > > you might want to just define it once in global.asa,
> > > and have it vary its behavior based on what script
> > > is calling it, which you can get from $0, or
> > > &File::Basename::basename($0)
> >
> > Shit, It was in your documentation, and I forget about it. May be there
is a
> > reason write down some attentions to Windows ASP programmers, I just
migrate
> > my Windows ASP technology to Apache::ASP did't get any attentions while
>
> Let me know if you had any hiccups in particular while
> migrating that I can help, like compatibility issues ?

There was a need of IncludesDir and Buffering was broke, but you done it.

And may be you need to try insert some attentions on compile while there are
subs with the same name in 2+ scripts
Btw, we can suppose that two users place their own scripts in one
application and named subs the same...
Although you may say, that for every independent user we need create new
application.

> > Nope, routines has very different implementation, which is own for every
> > script. I'll need to give subs different names, for example, with
prefix - script name.
> > What a pity... Compiling to unique packages a little decreased
performance,
> > as I understand, because default for UniquePackages is off...
> >
>
> Try the UniquePackages config, I don't think there is a difference
> on performance, not much anyway, it seemed more natural to that
> compiled includes be able to see the same globals as the main script,
> which was the motivation for not making it the default.

With UniquePackages I can't call subs defined in DynamicIncludes, because
DynamicInclude is compiled to own package.
May be is there reason to give by compiler a unique name for subs in scripts
and leave UniquePackages off ?

Global.asa
---------------------
sub shared_one {
print "Some global text";
};

---------------------

include.inc
---------------------
<%
sub shared_two {
%>
Some global text
<%
};
%>
---------------------

script.asp
---------------------
<!--#include file=include.inc -->
<%
sub test{
};

shared_one();
shared_two();
test();
%>
---------------------
But compiler translate it to
script.asp
---------------------
<!--#include file=include.inc -->
<%
sub <unique_prefix>_test{
};

shared_one();
shared_two();
<unique_prefix>_test();
%>
---------------------

While I writing it, I think, it is more Windows ASP way than perl
Apache::ASP, although I don't know perl good as C or ASP.
May be better way is implement include.inc as package and use
UniquePackages? And my includes contains only subs.

Package.pm
-------------------
sub shared_two {

    my($request) = $main::Request;                                <<< But it
is not elegant as include.inc
    my($env) = $request->Write("some global text");


};

---------------------

script.asp
---------------------
<%
use Package;
sub test{
};

shared_one();
shared_two();
test();
%>
---------------------

The only one method I see, it is call all subs in scripts with unique
prefix.

----------------------------------------------
Sergey Polyakov (BeerBong)
Chief of Web Lab (http://www.mustdie.ru/~beerbong)



Reply via email to