> "Weyer, Jens" wrote:
> 
> Hello !
> 
> First of all I would like to introduce myself, because i am new to this mailinglist.
> My name is Jens, i am living in Germany and i am 24 years old.
> I've been working with Linux, Perl, HTML and all the stuff around since 1996,
> so I would suppose, that I am not new to the internet-djungle :-)
> 

Yeah, you are an old timer all right.  Welcome to the club. :)

> Nevertheless - we did not want to swap our Linuxserver with a m$ IIS...
> We could arrange it, that we can keep our Server on running as it is, but
> we still had to use ASP... So I found the Apache::ASP project.
> 

I implemented the buzzword because I figured there would be greater
acceptance of the platform as a technology.  Thanks for the validation
of the approach.  & between Apache::ASP & Linux, I could not ask for
a nicer web dev enviroment.

> Now there is a huge problem: We have an ASP file for every page on
> that server, and in each file exists the same subs like
> Write_Content_HTML() and so on. We include there the main content
> of each webpage dynamically. There are more such subs, but one should

I think it is bad form to define subroutines in ASP scripts.  
However, like you found, setting UniquePackages to 1 can make
it so that redefinition warning go away.  But then you no longer
have the global namespace to work with, so right your code stops
working that was relying on this.

You should find some way to share your subroutines ideally.
One easy was to do this is to put them all in the global.asa
file, and pass parameters to them to change their behavior
on a per script basis.  Another thing to try is to decomp
your application logic into a global object with methods.
You can set the global object in global.asa like:

== httpd.conf
  PerlSetVar UseStrict 1
 
== global.asa
 use vars qw($Object);
 sub Script_OnStart {
   $Object = Object->new();
 }

Then you can call in each script:

  <% $Object->Write_Content_HTML(); %>

Depending on the $Object state, your method call might change
its behavior, so you can tailor the method execution on 
a per script basis that way too.  Sometimes objects are 
better for state control, than passing parameters.

A more concrete script example might suggest better what 
approach might work here if the above didn't help enough.

--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]

Reply via email to