this may be a dumb patch to Apache::ASP (at least it is my first).

Rationale:

i have the following issues with the current implementation of $Application

        1. everything you store in $Application->{foo} must be 
        serializable my MLDBM. (right?) i have SWIG'd c++ classes for
        which this will not work.

        2. limitation #1 seems to limit Apache:ASP's usefulness as a
        cross-platform solution to ActivePerl/IIS/ASP scripts you 
        want to move to linux, etc. i want to do this - not sure if
        this is really a key thing for joshua though...

So the following patch (which i really hope joshua comments on ;)
fixes my problems (or so it seems). i've made an $Application2 object
which uses the implementation from the mod_perl guide to make a
global variable accessible by all scripts. (i'd love for this to become
the real $Application). It doesn't do everything else $Application
does at this point, but does demonstrate the idea & works on my SWIG'd 
c++ stuff.

i'd love to know if i'm totally of the wall or how to improve this
idea. seems like it would be faster, more like IIS/ASP, and remove
the serializable requirement, although it would jack up memory 
requirements i would imagine. i'd be glad to incorporate any suggested
improvements to make it acceptable to Joshua for inclusion in
Apache::ASP...

--- ASP.pm      Thu Feb  3 20:35:08 2000
+++ /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm        Tue Mar 28 16:00:19 2000
@@ -1154,6 +1154,8 @@
 #         "use vars qw(\$".join(" \$",@Apache::ASP::Objects).');',
           "sub $subid { ",
           ' return(1) unless $_[0]; ', #@_ = ();',
+          "use vars qw(%Application2);",
+          "*Application2 = \\%Apache::ASP::InMemoryApplicationObject::Application2;",
           $$script,
           '}',
          );
@@ -2115,6 +2117,8 @@
                 $strict,
                 "use vars qw(\$".join(" \$",@Apache::ASP::Objects).');',
                 "use lib qw($self->{asp}->{global});",
+                "use vars qw(%Application2);",
+                "*Application2 = 
+\\%Apache::ASP::InMemoryApplicationObject::Application2;",
                 $code,
                 'sub exit { $main::Response->End(); } ',
                 '1;',
@@ -4464,6 +4468,13 @@
 
 sub connection { shift; }
 
+1;
+
+package Apache::ASP::InMemoryApplicationObject;
+    use strict;
+    use vars qw(%Application2);
+    %Application2 = (
+    );
 1;
 
 __END__


-- 
------------------------------------------------------------------------
Joel W. Reed                              http://ruby.ddiworld.com/jreed
--------Daddy, why doesn't this magnet pick up this floppy disk?--------


Reply via email to