Re: Foo::Bar vs. Foo::Bar

2000-07-23 Thread Perrin Harkins

Ade wrote:
> I have a module I've written, let's call it Foo::Bar.  Well, I have several
> projects running under mod_perl that use this module.  I add to the module
> from time to time, and thus newer projects will rely on a newer version of
> Foo::Bar.  All these projects are running on the same server, in the same
> mod_perl environment.  So there's a problem when one version of Foo::Bar
> gets cached and one script needs another version, but tries to use the one
> in memory 'cause all it knows is that it needs Foo::Bar.

Take a look at Apache::PerlVINC.
- Perrin



Foo::Bar vs. Foo::Bar

2000-07-23 Thread Ade

I'm having problems with cached modules, and I'm wondering if somebody will 
help me out.

I have a module I've written, let's call it Foo::Bar.  Well, I have several 
projects running under mod_perl that use this module.  I add to the module 
from time to time, and thus newer projects will rely on a newer version of 
Foo::Bar.  All these projects are running on the same server, in the same 
mod_perl environment.  So there's a problem when one version of Foo::Bar 
gets cached and one script needs another version, but tries to use the one 
in memory 'cause all it knows is that it needs Foo::Bar.  Thus Project A 
gets run first and uses an early version of Foo::Bar.  That version gets 
cached and when Project B gets run, it has problems 'cause it uses the 
early version of Foo::Bar.  Each project has their appropriate 'use lib 
qw()' paths set.  This is what my apache config looks like for the project dir:


 
 SetHandler perl-script
 PerlHandler Apache::Registry
 Options +ExecCGI +Includes
 PerlSendHeader On
 PerlInitHandler Apache::StatINC
 PerlSetVar StatINCDebug On
 


And I'm using Apache 1.3.12 and mod_perl 1.24.

Thanks for any help you can give.

--Ade.


Re: Apache::ASP Error

2000-07-23 Thread Joshua Chamas

Dmitry is right, if you need more help, you should
set Debug to 2 and set the error output as well as your
the relevant part of your script.

--Joshua

_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051

Hans Fuchs wrote:
> 
> Hello,
> 
>   I installed Apache::ASP. When test with a simple asp page. I got an
>   internal server error and the error_log says:
> 
>   [Sun Jul 23 15:54:44 2000] [error] [asp] [14779] [error] Can't
>   modify constant item in scalar assignment at (eval 11) line 66, at
>   EOF <--> , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1740
> 
>   What can I do?
> 
> Best,
>Hans
>



Re: Apache::Session and blessed references

2000-07-23 Thread Jeffrey W. Baker

On Wed, 31 May 2000, Dylan Weed wrote:

> 
> I can't seem to get Apache::Session to save the blessedness of an object.  
> Is this an oversight on my part, a limitation of the module, a limitation
> of the database, or an intentional design decision?  
> 
> Conceptually, it seems as though an objects blessing is stored in a
> different place in the Perl guts than its contents.  Is the problem just
> that Apache::Session never saves this information to the database?
> 
> Has anyone else had occasion to do this?
> 
> 
> 
> An example in Perl:
> 
> # %session is a hash tied to a DB with Apache::Session 1.51
> 
> package main;
> 
> my $dog_obj = { name => 'Fido', breed => 'Mutt' };
> 
> bless ($dog_obj, 'Dog');
> 
> $dog_obj->bark();
> $session{my_dog} = $dog_obj;
> 
> # The following line dies with an error:
> #   cannot call method bark on unblessed reference.
> $session{my_dog}->bark();
> 
> package Dog;
> 
> sub bark {
>   my $self = shift;
>   print "Woof! I'm $self->{name}";
> }


You know, I thought that there was a problem here when I first saw this
email, but today I simply cannot reproduce it.  When I run the example
program, everything barks.

Can you still reproduce this problem, and, if so, could you please send me
a complete, working perl program as a demonstration?

Regards,
Jeffrey




Re: ApacheCon Europe - thoughts please ?

2000-07-23 Thread Richard Dice

> I am considering going to the ApacheCon Europe to see what's said and
> put a few faces to names and meet a few people.

So am I.  And I'd be shipping myself in from Montreal/Toronto for it.
I'm sure it will be worth the money, but I sympathise in terms of paying
out of pocket for it as well, as I'd be doing the same.

I'm not sure if it's "a fair reflection" of the price of having an attendee
there, but that's not what it's about:  It's about making money.  The 
conference organizers have their dreams of financial security, too, and
are looking for an appropriate work/risk/reward pay-off as well.
 
I don't think you're being a scruge.  It's a lot of money to be looking
at -- I know. :-)

History will show whether I get up the guts to write the cheque myself.

Cheers,
Richard

-- 

 Richard Dice * Personal 514 816 9568 * Fax 514 816 9569
 ShadNet Creator * http://shadnet.shad.ca/ * [EMAIL PROTECTED]
 Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/
 "squeeze the world 'til it's small enough to join us heel to toe"
 - jesus jones



Re: OSS/Perl Conference Report

2000-07-23 Thread Perrin Harkins

On Sun, 23 Jul 2000, Matt Sergeant wrote:

> I've put my report on the OSS/Perl conference online for all to
> see. Hopefully you'll find it vaguely interesting in parts. Its at
> http://modperl.sergeant.org/oss-conf-report.txt

"On Wednesday I first went to Andy Wardley's Template Toolkit BOF where he
showed us briefly how it works, and then I told him I might add support to
AxKit for TT2"

Hey, I was thinking about that too!  TT seems like such a natural fit for
this, and it looked like it would be pretty easy to add.  I don't have
time to code it right now, but I know a fair amount about how to use TT
efficiently from mod_perl and I'd be happy to answer questions.

- Perrin




Re: YAM (Yet Another Module) - an IPC shared cache thing - anyoneinterested ?

2000-07-23 Thread Perrin Harkins

On Fri, 21 Jul 2000, Greg Cope wrote:
> I've writen a small IPC sysV based shared cache thingy ... (useing
> IPC::ShareLite), and I'd like some comments oin the design if anywants
> to crtique...

Can you explain how your approach is different from the ones in
IPC::Shareable, IPC::Cache, IPC::SharedCache, IPC::MM (using shared hash),
File::Cache, and BerkeleyDB, and list some advantages/disadvantages of
your module?  Your module may be great, but it's hard for people to know
which one to use in this crowded field without some explanation of the
differences.

- Perrin




startup file

2000-07-23 Thread Paul Phillips

Hello, all,

I'm quite noew to modperl.  I've written a cgi, using cgi.pm that I am 
moving to modperl.  The cgi is written as one main program, with a number 
of subroutines spread across three libraries that are required into the 
main program.

If I list the main program in my startup file, so it is loaded on server 
startup, does it load the external libraries as well?

Thanks,

___
Paul Phillips
Director of Orchestral Activities, Meadows School of the Arts
Southern Methodist University

"You must sing every note you play, sing even through the rests!"
Arturo Toscanini



Aborting Apache startup during PerlInitHandler

2000-07-23 Thread Thomas Klausner

Hi!

I have got a PerlInitHandler that does some config parsing etc.

I would like Apache to stop starting up and to print out some error
message ("Config Directive blabla missing" or something like that) if
an error occures during config parsing. (As it is happing when
something is wrong with the Apache Config (httpd.cfg ...))

How can this be done?
-- 
D_OMM  http://domm.zsi.at
O_xyderkes
M_echanenNEU: Evolution meines Musikgeschmackes
M_asteuei http://domm.zsi.at/curvit/musik.html




Re: YAM (Yet Another Module) - an IPC shared cache thing - anyone interested ?

2000-07-23 Thread Greg Cope

Joshua Chamas wrote:
> 

> I would recommend using Apache::ASP as it does everything you need.
> First it allows for creation of your dynamic tags:
> 
>   http://www.nodeworks.com/xml.html
> 
> It will reload all of your templates dynamically at runtime, for
> ease of development but also has advanced server startup parent
> httpd compilation abilities for greatest scalability, where templates
> are shared across child forks:
> 
>   http://www.nodeworks.com/asp/tuning.html#Precompile%20Scripts
> 
> Finally, it will give your designers a comfortable ASP scripting
> environment, while giving you the developer powerful APIs like
> the Script_OnStart event which you can use to customize the
> global environment available to each script:
> 
>   http://www.nodeworks.com/asp/events.html#Script_OnStart%20%26%20Script_OnEnd
> 
> If you think its scarey that designers might be able to execute
> arbitrary perl code in <% %> blocks, I have thought about allowing
> a config option to turn these blocks off, so the compiler will
> just strip them or render the raw code by default.  Might be like
> 
>   PerlSetVar CodeBlocks 0
> 
> This way, your designers would only be able to use the custom tags
> that you provide for them.


Thanks Joshua

I was aware that Apache::ASP did all the some of these things but not
all of this - and I see you will be including some XML support  I am
truely impressed (the caching bit, and the script environment changes).

My aims have thus far been to write my own modules that just do what I
need and no more, so that Firstly its efficient (no excess code, not to
say Apache::ASP has any of that ;-), and Secoundly to learn some more.

This does mean I reinvent the wheel code wise, compared to projects like
yours, HTML::Embperl, HTML::Template - but I'll learning in the mean
time.  I am not expecting to release anything on CPAN or for the code to
be used by anyone else.

If anything I've been introduced to HML::Template - which is just the
lightwieght templating module that would help with my present (work)
project (I'd use my own  module, but using a maintained CPAN module
would be better for my clients in the long term (i.e after I've left)).

Thanks again for the pointer.

Greg Cope

> 
> -- Joshua
> _
> Joshua Chamas   Chamas Enterprises Inc.
> NodeWorks >> free web link monitoring   Huntington Beach, CA  USA
> http://www.nodeworks.com1-714-625-4051




Re: OSS/Perl Conference Report

2000-07-23 Thread Greg Cope

Matt Sergeant wrote:
> 
> I've put my report on the OSS/Perl conference online for all to
> see. Hopefully you'll find it vaguely interesting in parts. Its at
> http://modperl.sergeant.org/oss-conf-report.txt

Thanks Mat - much appreciated.

It seems difficult to get a concise view of what people are playing with
(not only Doug's MPM threaded model, DBI connection pools, but now
hotspot style op code removal ...) development wide - without
subscribing to loads of lists, and even then there is on guarantee  of
any news!

Sounds like a good time was had by all.

Thanks again for the resumee.

Greg Cope.


> 
> --
> 
> 
> Fastnet Software Ltd. High Performance Web Specialists
> Providing mod_perl, XML, Sybase and Oracle solutions
> Email for training and consultancy availability.
> http://sergeant.org | AxKit: http://axkit.org





Re: Apache::ASP Error

2000-07-23 Thread Dmitry Beransky

The error is in your simple asp page on line 66.  Most likely you forgot
to put '$' in front of a variable.

Dmitry

On Sun, 23 Jul 2000, Hans Fuchs wrote:

> Hello,
> 
>   I installed Apache::ASP. When test with a simple asp page. I got an
>   internal server error and the error_log says:
> 
>   [Sun Jul 23 15:54:44 2000] [error] [asp] [14779] [error] Can't
>   modify constant item in scalar assignment at (eval 11) line 66, at
>   EOF <--> , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1740




Apache::ASP Error

2000-07-23 Thread Hans Fuchs

Hello,

  I installed Apache::ASP. When test with a simple asp page. I got an
  internal server error and the error_log says:

  [Sun Jul 23 15:54:44 2000] [error] [asp] [14779] [error] Can't
  modify constant item in scalar assignment at (eval 11) line 66, at
  EOF <--> , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1740

  What can I do?

Best,
   Hans

-- 
Gesendet an [EMAIL PROTECTED] am 23.07.2000 mit The Bat 1.42f
Homepage: http://www.enova.ch - EMail: [EMAIL PROTECTED]
Public Key: http://www.enova.ch/gucky/gucky.htm

"Funkybeats for ever!"

Anhang: 





[OT] strange mod_rewrite behaviour (for Apache::Session support)

2000-07-23 Thread Louis-David Mitterrand

Hello,

I am in the process of implementing persistent sessions using
Apache::Session with the session_id stored in the URL and it mostly
works. In the HTML::Mason autohandler there is the following filter:

<%filter>
$r->pnotes("cookie") # mangle URL only if cookie is missing
|| s#\bhref\s*=\s*"(/(?!S=)[^"\s]*)"#href="/S=$session{_session_id}$1"#gi;


... which adds the session_id to all href links, only if the browser
doesn't return any cookie.

Now in httpd.conf there is a mod_rewrite rule inspired by a recent
thread on the modperl list:

RewriteRule ^/S=([^/]+)(/.*) $2 [E=AF_SID:$1]

This removes the session_id from the URL and adds it to the AF_SID
environment variable. This works well for all absolute URLs (starting
with a /) which is puzzling because I remember reading in this thread
that this technique mandated _relative_ URLs.

The rewrite rule fails only in one case, the root URL:

http://my.site.com/S=1d2e580af1e31cf2/Sell/index.html

... is correctly converted to 

http://my.site.com/Sell/index.html

... *but*

http://my.site.com/S=1d2e580af1e31cf2/

... fails with a 404 NOT FOUND error

>From the rewrite log:

127.0.0.1 - - [23/Jul/2000:15:57:31 +0200] [apartia.int/sid#815769c][rid#8149464
/initial] (2) init rewrite engine with requested uri /S=3b2c1685dcc26394/
127.0.0.1 - - [23/Jul/2000:15:57:31 +0200] [apartia.int/sid#815769c][rid#8149464
/initial] (3) applying pattern '^/S=([^/]+)(/.*)' to uri '/S=3b2c1685dcc26394/'
127.0.0.1 - - [23/Jul/2000:15:57:31 +0200] [apartia.int/sid#815769c][rid#8149464
/initial] (2) rewrite /S=3b2c1685dcc26394/ -> /
127.0.0.1 - - [23/Jul/2000:15:57:31 +0200] [apartia.int/sid#815769c][rid#8149464
/initial] (2) local path result: /
127.0.0.1 - - [23/Jul/2000:15:57:31 +0200] [apartia.int/sid#815769c][rid#8149464
/initial] (1) go-ahead with / [OK]
[Sun Jul 23 15:57:31 2000] [error] [client 127.0.0.1] File does not exist: /

... so after tinkering with various mod_rewrite options for a while I
changed the RewriteRule to:

RewriteRule ^/S=([^/]+)(/.*) %{DOCUMENT_ROOT}$2 [E=AF_SID:$1]

... and now everything works fine. 

But I'm still not happy because I don't understand _why_ it works.

Please let me know if you have a rational explanation.

TIA

-- 
Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.apartia.fr

# rm *;o
o : command not found



OSS/Perl Conference Report

2000-07-23 Thread Matt Sergeant

I've put my report on the OSS/Perl conference online for all to
see. Hopefully you'll find it vaguely interesting in parts. Its at
http://modperl.sergeant.org/oss-conf-report.txt

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org | AxKit: http://axkit.org




Re: YAM (Yet Another Module) - an IPC shared cache thing - anyoneinterested ?

2000-07-23 Thread Greg Cope

"T.J. Mather" wrote:
> 
> Have you considered using HTML::Template?  It is a simple yet powerful way
> to seperate HTML from Perl code.  It can do loops (good for HTML
> tables), includes, and if/unless/else statements.  Furthermore, it has
> shared memory for templates built in.
> 
> http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search?dist=HTML-Template-1.8

Thanks for that.

Looking at that lead me IPC::SharedCache - which is almost exactly what
I have decided to do - albiet Sam Tregar's implementation appears alot
better.

My Implentation of the template is very simple - i.e you give it a
template, then ask it to sub in all the values into the tag locations,
and return a scalar ref.  There are a few other methods (for defining
tags and their values) -p but thats it.

I seem to have implemented an HTML::TemplateLite and IPC:SharedCacheLite
 I have learned alot and can always reuse the code in the orginals -
this is after all perl 

Thanks again.

Greg Cope