Re: VBScript parser (was Re: Apache::ASP Question)

2000-07-24 Thread Matt Sergeant

On Mon, 24 Jul 2000 [EMAIL PROTECTED] wrote:

> --
> 
> On Mon, 24 Jul 2000 13:19:51   Joshua Chamas wrote:
> >Until I write a VBScript to perl parser, yes you can only
> >use perl under Apache::ASP.
> 
> Ok, so are you actually going to write a VBScript to perl parser?  I
> was actually thinking of undertaking this project myself, but I've
> never written a lexer or a parser or anything like that.  If you _are_
> going to do this I'd be glad to help.  If not, I'm probably going to
> get started with it anyways.  I realized a huge need for something
> like this since I've been working on a large site (high volume + large
> codebase) converting from WinNT/ASP to Solaris/Perl/CGI (with mod_perl
> of course).  I've written a _really_ simple script that converts stuff
> like "For i = 1 To 10" to "for (1..10) {" etc., but it's of course
> really flaky and unreliant (although it knocks out about 90% of the
> manual code conversion).
> 
> Ok, so what was the point again??  Oh yeah, are you really going to do
> this?  :-)  Or is someone else already in the process?

I wrote a naive thing for converting scriptlets to perl scriptlets
(scriptlets let you write COM objects in scripting code), but it's not
very complete either. It's somewhere on my old fastnetltd web pages at
http://come.to/fastnet

-- 


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




VBScript parser (was Re: Apache::ASP Question)

2000-07-24 Thread

--

On Mon, 24 Jul 2000 13:19:51   Joshua Chamas wrote:
>Until I write a VBScript to perl parser, yes you can only
>use perl under Apache::ASP.

Ok, so are you actually going to write a VBScript to perl parser?  I was actually 
thinking of undertaking this project myself, but I've never written a lexer or a 
parser or anything like that.  If you _are_ going to do this I'd be glad to help.  If 
not, I'm probably going to get started with it anyways.  I realized a huge need for 
something like this since I've been working on a large site (high volume + large 
codebase) converting from WinNT/ASP to Solaris/Perl/CGI (with mod_perl of course).  
I've written a _really_ simple script that converts stuff like "For i = 1 To 10" to 
"for (1..10) {" etc., but it's of course really flaky and unreliant (although it 
knocks out about 90% of the manual code conversion).

Ok, so what was the point again??  Oh yeah, are you really going to do this?  :-)  Or 
is someone else already in the process?

- Matt Barnicle


--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.



mixed httpd.conf => mixed results

2000-07-24 Thread Stéphane Payrard


At the end of an httpd.conf that contains both perl and apache traditional config 
material,
I tried to list the resulting configuration (here only Locations and VirtualHosts).
Only the material belonging to the perl section was listed. That puzzles me.

I tried an empty perl section at the beginning so that any tying magic would
be active for traditional sections. To no avail.


# stuff to dump the config.


use Data::Dumper;
 print STDERR __PACKAGE__, "\n";  # gave me ApacheReadConfig (useful info)
print STDERR Dumper( { Location => \%Location},  VirtualHost => \%VirtualHost );


-- 
  Stéphane Payrard
   email   : [EMAIL PROTECTED]
   portable: 06 60 95 82 69
  



Re: module multi-config strategy

2000-07-24 Thread Perrin Harkins

On Mon, 24 Jul 2000, martin langhoff wrote:
> Now, the idea is to have one codebase, written in a module that serves
> all of our sites. Each site should have its own (rather complex)
> config. Each and every subroutine must know in which context it's
> being called, and I don't really want to pass the config as a
> parameter to every damned sub.

You can have a module full of globals that is different for each site (it
doesn't have to go in the same directory as your other shared code), or
you can put things in httpd.conf with PerlSetVar and read them with
$r->dir_config(), which allows a separate configuration for each virtual
host.

- Perrin




Re: Mail delivery failed: returning message to sender

2000-07-24 Thread Greg Cope

Mail Delivery System wrote:
> 
> This message was created automatically by mail delivery software.
> 
> A message that you sent could not be delivered to one or more of its
> recipients. The following address(es) failed:
> 
>   [EMAIL PROTECTED]:
> SMTP error from remote mailer after RCPT TO:<[EMAIL PROTECTED]>:
> host mail.apache.org [63.211.145.10]:
> 553 Open relay problem - see 
>http://www.mail-abuse.org/cgi-bin/nph-rss?195.102.240.129>
> 
> -- This is a copy of the message, including all the headers. --
> 
> Return-path: <[EMAIL PROTECTED]>
> Received: from [212.134.215.254] (helo=rubberplant.freeserve.co.uk)
> by serv1.is1.u-net.net with esmtp (Exim 3.12 #1)
> id 13Gf2m-0004W7-00; Mon, 24 Jul 2000 11:01:04 +0100
> Sender: greg
> Message-ID: <[EMAIL PROTECTED]>
> Date: Mon, 24 Jul 2000 10:01:09 +
> From: Greg Cope <[EMAIL PROTECTED]>
> X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686)
> X-Accept-Language: en
> MIME-Version: 1.0
> To: Perrin Harkins <[EMAIL PROTECTED]>
> CC: Modperl list <[EMAIL PROTECTED]>
> Subject: Re: YAM (Yet Another Module) - an IPC shared cache thing -
>  anyoneinterested  ?
> References: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
> 
> Perrin Harkins wrote:
> >
> > 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/disadvantag
> > 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.
 
 I did not realise that the field was so crowded - my appologies - It
 appears that I have opened my mouth too soon - and that these modules
do
 the more than mine, and better.
 
 Basically its a light weight variant of HTML::Template - i.e it allows
 you to define tags, with values, that are substituted into a template
 when you ask for the content.  This template is stored in a Shared
(IPC)
 Cache (again in a very similar way to IPC::SharedCache).  The lightness
 of the module is evident in that it is just over 100 lines (at the
 moment!).
 
 Since I was refered to HTML::Template I then found all thse other
 modules and have been grapleing with wether to use those, or my own.  I
 think I'll carry on with mine for my projects (and as a learning
 excercise) - and use the others when clients need that functionality,
so
 that when I leave they can use the maintained CPAN modules.
 
 Hope that clarifies some of the confusion I appear to have created.
 
 Greg Cope
 
> > - Perrin





Re: ApacheCon Europe - thoughts please ?

2000-07-24 Thread Greg Cope

Richard Dice wrote:
> 
> > 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.

I've now reconsidered and am trying to summon up the will to write the
cheque as well.

Greg Cope

> 
> 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: Apache::ASP Question

2000-07-24 Thread Joshua Chamas

Victor wrote:
> 
> So to move a page written in VB to unix, I'd need something like ChilliSoft
> ?
> 

Until I write a VBScript to perl parser, yes you can only
use perl under Apache::ASP.  I found VBScript to be an utterly
crippled language a couple years ago when I started this project
but I absolutely loved ASP with session management, nice API,
excellence scripting syntax etc.

A note about performance... VBScript does extremely well
on small trivial scripts.  Perl's runtime strength lies in 
larger more complex programs.  The same is true when looking
at perl vs. PHP.  An unofficial benchmark I heard for a real
application was that a script ported to Apache::ASP with 
heavy DBD::Oracle access had 10 times better performance than 
the original ASP script under NT/IIS on the same hardware.

Note that Apache::ASP itself is very fast, and only slightly
slower than Apache::Registry CGI scripts.  Further, you get
other performance advantages when using perl database access,
and Apache, than when under NT/IIS/ASP.  The benchmarks
at http://www.chamas.com/bench don't capture these differences
because the "Hello World" bench is so simple, and only test
startup speed differences, not runtime language advantages.

Yes, we need a better benchmark, but these things take a lot
of time. :)

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



module multi-config strategy

2000-07-24 Thread martin langhoff

hi list,

i'm about to start writing the first of a series of internal modules,
aimed at handling common features among sites we develop. Like, let's
say, a 'latest news' box or a product guide/database. 

Now, the idea is to have one codebase, written in a module that serves
all of our sites. Each site should have its own (rather complex) config.
Each and every subroutine must know in which context it's being called,
and I don't really want to pass the config as a parameter to every
damned sub. 

Currently, I keep the configs as a global hash inside the module,
that's good when you've got one module per implementation. I won't scale
further justlike that. 

Maybe I should have a hash inside the module, with the $ENV{HTTP_HOST}
or $ENV{'SERVER_NAME'} as key and the configs as values. Maybe this same
setup in a mysql table. But that'd allow only one implementation of each
module per domain. And I think that maybe I'll someday need, say, 2
product guides (under different brands) in the same site / page. 

So that's not 'THE' way. Maybe something intermediate. But I don't
really know how. Does anyone want to share his views on this? 

Maybe I could build a wrapper module, that manages the configs and sets
them up in the environment. That'd be nice to post in CPAN. 



martin



Re: Apache::ASP Question

2000-07-24 Thread Vivek Khera

> "V" == Victor  <[EMAIL PROTECTED]> writes:

V> So to move a page written in VB to unix, I'd need something like ChilliSoft
V> ?

Perhaps. Or maybe the ASP to PHP converter will do it for you?  I hear
rumors of such a thing that will convert your M$ ASP to php.

But that's not Perl... ;-)

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
GPG & MIME spoken herehttp://www.khera.org/~vivek/



Re: Apache::ASP Question

2000-07-24 Thread Matt Sergeant

On Mon, 24 Jul 2000, Victor wrote:

> I am trying to figure out what Apache::ASP is and how well it works. Can
> anyone point me to information on the following points or provide me
> with answers to the following?
> 
> 1. How compatible is Apache::ASP with ASP?

Pretty good - I worked with Joshua a long time ago to make sure that the
PerlScript and Apache::ASP were compatible. Apache::ASP scripts are not
necessarily compatible with PerlScript though, because they provide a
richer API, and some short-cuts.

> 2. How well does Apache::ASP perform?

Pretty good. Probably about as well as PerlScript, or better. Not as good
as VBScript ASP's though. See the benchmarks linked to from 
http://perl.apache.org/

> 3. Can Apache::ASP use COM?

Only on windows, via the Win32::OLE module.

> 4. What platforms does Apache::ASP run on?

All of them. :-)

> I also wanted a clarification of ASP. As I understand it, ASP is M$'s
> version of VB that runs in a way similar to how php does? Is ASP a
> language or ... ? Does Apache::ASP support the vb syntax ?

ASP is a cross platform API, not a language. Apache::ASP implements the
API that ActiveState's PerlScript and MKS' PScript implements.

-- 


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 Question

2000-07-24 Thread Victor

So to move a page written in VB to unix, I'd need something like ChilliSoft
?

Vivek Khera wrote:

> > "V" == Victor  <[EMAIL PROTECTED]> writes:
>
> V> I also wanted a clarification of ASP. As I understand it, ASP is M$'s
> V> version of VB that runs in a way similar to how php does? Is ASP a
> V> language or ... ? Does Apache::ASP support the vb syntax ?
>
> No, ASP on M$ is _usually_ written in VB.  It is not a language, but a
> framework; You can write ASP pages in any language.  Apache::ASP lets
> you do it in Perl.




Re: Unexpected pnotes() behavior

2000-07-24 Thread JoshNarins

I think you've made a closure...

my $subref;
{
  my $a = "hi!"
  $subref = sub { print "$a\n" };
  $a = "huh?";
}
&$subref; #prints "huh?"

Is $r->pnotes really making a subref? I'm only starting
to get familiar with Apache.xs but I can tell that
notes is implemented directly on top of an Apache::Table
while pnotes involves much more stuff that I can't
speak about at this time.



Re: Apache::ASP Question

2000-07-24 Thread Vivek Khera

> "V" == Victor  <[EMAIL PROTECTED]> writes:

V> I also wanted a clarification of ASP. As I understand it, ASP is M$'s
V> version of VB that runs in a way similar to how php does? Is ASP a
V> language or ... ? Does Apache::ASP support the vb syntax ?

No, ASP on M$ is _usually_ written in VB.  It is not a language, but a
framework; You can write ASP pages in any language.  Apache::ASP lets
you do it in Perl.



Apache::ASP Question

2000-07-24 Thread Victor

I am trying to figure out what Apache::ASP is and how well it works. Can
anyone point me to information on the following points or provide me
with answers to the following?

1. How compatible is Apache::ASP with ASP?
2. How well does Apache::ASP perform?
3. Can Apache::ASP use COM?
4. What platforms does Apache::ASP run on?

I also wanted a clarification of ASP. As I understand it, ASP is M$'s
version of VB that runs in a way similar to how php does? Is ASP a
language or ... ? Does Apache::ASP support the vb syntax ?

Thanks for any input.
Victor




Unexpected pnotes() behavior

2000-07-24 Thread Dan Rench

I had a situation where a pnotes() key set in one phase had a value I
did not expect in a later phase.  Here's a small module that I wrote
as a HeaderParserHandler to illustrate:

package Ii::Apache::pnotes;
use Apache::Constants 'OK';

sub handler {
my $r = shift;
$r->push_handlers('PerlFixupHandler' => \&other_phase);
my $n = 'I set this during the '.$r->current_callback." phase\n";
$r->notes('sample_note', $n);
printf STDERR '%s: %s', $r->current_callback(), $n;
$n = "I set this to something else before returning.\n";
return OK;
}

sub other_phase {
my $r = shift;
printf STDERR '%s: %s',
$r->current_callback(), $r->notes('sample_note');
return OK;
}

1;
__END__

...and here's what I get in my error_log:

PerlHeaderParserHandler: I set this during the PerlHeaderParserHandler phase
PerlFixupHandler: I set this to something else before returning.

If I s/pnotes/notes/ then I get what I expected:

PerlHeaderParserHandler: I set this during the PerlHeaderParserHandler phase
PerlFixupHandler: I set this during the PerlHeaderParserHandler phase

I had gotten into the habit of using pnotes() all the time no matter
what sort of value I was passing around, but it seems that if it's going
to be a regular scalar, notes() is how it must be, or I've got to be careful
not to change that variable after I set the pnotes() field.  The behavior
surprized me because I wasn't passing a reference, yet pnotes() acts like
I did.  In case anyone's wondering: apache 1.3.12, mod_perl 1.24.




[ANNOUNCE] Apache::Session 1.52

2000-07-24 Thread Jeffrey W. Baker

Apache::Session 1.52 has been uploaded to CPAN.  The main change in this
version is the inclusion of modules to work with Sybase, contributed by
Chris Winters, and a smattering of bugfixes.

There is a memory leak if you use a persistent database handle with
Apache::Session.  The memory leak is in DBI, and I haven't had a chance to
fix it yet.  You can minimize the impact of the leak by occassionally
letting your Apache children die, or re-opening your database connections.

Get the new Apache::Session here:
http://www.perl.com/CPAN/modules/by-authors/Jeffrey_Baker/

-jwb





Re: Apache::Session - can't undef %session?

2000-07-24 Thread Perrin Harkins

On Mon, 24 Jul 2000, Kenneth Lee wrote:
> I found that if I explicitly undef %session, CLEAR will be triggered 
> before DESTROY clearing $self->{data}, so $self->save actually update 
> nothing in the database.

The perltie page says that this will happen when assigning the empty list
to a tied hash, and apparently it happens when you undef as well.  Maybe
you want to call DESTROY or untie instead.

- Perrin




Re: my first attempt at a perl script (syntax error)

2000-07-24 Thread Vivek Khera

> "SC" == Sam Carleton <[EMAIL PROTECTED]> writes:

SC> Alex Farber wrote:
>> maybe you should read some introductionary Perl
>> books, like http://www.effectiveperl.com/toc.html or
>> http://www.ebb.org/PickingUpPerl/pickingUpPerl.html

SC> Maybe I have read things like "Programming Perl" from O'Reilly and
SC> "Writting Apache Modules in Perl and C", am tired of reading page after
SC> page and want to do some real coding.  Maybe I thought that folks in the
SC> mod_perl mailing list would be understanding of someone who has spent
SC> many years in another language and needs a little help overcoming some
SC> syntax issues.

If you're having syntax issues then you *really* need to refer to the
docs.  You don't need to read the whole damned book; just look up the
function with which you have problems in the index or online docs.  It
is not that hard to see the syntax of open() and compare it to what
you have to see why it fails.


And the mod_perl list is *NOT* for intro to perl questions.  It is
about mod_perl, not generic perl.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
GPG & MIME spoken herehttp://www.khera.org/~vivek/



Re: PerlSetupEnv is evil

2000-07-24 Thread Eric Cholet

> > -Original Message-
> > From: Roger Espel Llima [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, July 07, 2000 5:19 PM
> > To: [EMAIL PROTECTED]
> > Cc: [EMAIL PROTECTED]
> > Subject: PerlSetupEnv is evil
> > 
> > 
> [snip]
> > 
> > It also turns out that specifying "PerlSetupEnv Off" outside of any
> >  apparently gets ignored.  Is that a bug?  I put another
> > "PerlSetupEnv Off" in the  entry for the DocumentRoot, and
> > now it's not doing these annoying subrequests anymore.
> 
> it is a bug (prior report:
> http://marc.theaimsgroup.com/?l=apache-modperl&m=95867712412668&w=2) -
> PerlSetupEnv is not inheriting properly.
> 
> I think this fell to low on the ToDo list since there is a (rather lengthy)
> workaround of sprinkling PerlSetupEnv Off everywhere you need/want it.

I've just committed a change which fixes this. Please try it and let me know
if it works for you.

--
Eric





Re: howto config apache to allow perl to filter php pages

2000-07-24 Thread darren chamberlain

Aaron Johnson ([EMAIL PROTECTED]) said something to this effect:
> I was thinking about the same thing awhile back.  It was interesting to me that
> lots of neat applications are PHP based.  I would like to be able to take the
> processed PHP page and include it inside of my mod_perl page.  I was thinking
> there are several ways I could handle.  I can have a seperate directory that
> process the php files and just use the LWP::Simple to get the page as a
> processed string.  Then replace any content with =~ s/blah/cool/ inside of the
> mod_perl processed page.  I do this with some cgi programs that I use
> currently.  It works ok, but the overhead must be tremendous.  Anybody else done
> anything similar?

Why not use a subrequest?

Get your content, generate the URI. Call:

my $subr = $r->lookup_uri($uri);
$subr->run;

And your subrequest (be it a mod_perl page, PHP, cgi, or static HTML) get
executed in the place where you call $subr->run.

Apache itself does tons of subrequests. mod_autoindex, for example.

And, actually, using LWP::Simple isn't that much extra overhead, provided it
already loaded and all that. Although I'd use LWP::UserAgent, not LWP::Simple.

(darren)

-- 
"The bad reputation UNIX has gotten is totally undeserved, laid on by people
who don't understand, who have not gotten in there and tried anything."
-- Jim Joyce, owner of Jim Joyce's UNIX Bookstore



Re: OSS/Perl Conference Report

2000-07-24 Thread Matt Sergeant

On Mon, 24 Jul 2000, Gunther Birznieks wrote:

> I have to say that I really enjoyed reading this. Especially since I was 
> stuck halfway around the world and couldn't really go this year. :(
> 
> I wonder if the OReillyCon people would consider linking to this piece?

I've offered it to MJD/JonO for www.perl.com - assuming they'll be running
the same sort of thing as they did for YAPC.

-- 


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




Apache::Session - can't undef %session?

2000-07-24 Thread Kenneth Lee

Hi all,

I found that if I explicitly undef %session, CLEAR will be triggered 
before DESTROY clearing $self->{data}, so $self->save actually update 
nothing in the database.

  # Apache/Session.pm
  ...
  sub CLEAR {
warn "CLEAR!\n";
  ...
  sub DESTROY {
warn "DESTROY!\n";
  ...

  # The script
  ...
  tie %session, 'Apache::Session::Oracle', undef, {
...,
Commit => 1,
  };
  $session{array_ref} = [ 1..10 ];
  print "Storing session to database...\n";
  undef %session;  # Nothing stored

When executed, it gives

  bash$ perl test.pl
  Storing session to database...
  CLEAR!
  DESTROY!

Then I use SQLPlus to find in the database, the record is there, but 
it only contains the serialized form of { _session_id => xxx }, which is 
inserted by tie().

Can anyone explain this to me?

Thanks,
Kenneth



Re: OSS/Perl Conference Report

2000-07-24 Thread Gunther Birznieks

I have to say that I really enjoyed reading this. Especially since I was 
stuck halfway around the world and couldn't really go this year. :(

I wonder if the OReillyCon people would consider linking to this piece?

At 12:44 PM 7/23/00 +0100, 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
>
>--
>
>
>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

__
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Web Technology Company
http://www.extropia.com/




Re: OSS/Perl Conference Report

2000-07-24 Thread Matt Sergeant

On Sun, 23 Jul 2000, Perrin Harkins wrote:

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

It will be a while before I get around to doing any coding on this
whatsoever. I have a lot of work to do before ApacheCon to get something
working on what I've been promising people on. Maybe after then though!

-- 


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: ApacheCon Europe - thoughts please ?

2000-07-24 Thread Matt Sergeant

On Sun, 23 Jul 2000, Richard Dice wrote:

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

Do it - the mod_perl hackers are a fun bunch to spend time with, both in
and outside of conference hours. Think of it as a holiday where you learn
stuff!

-- 


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: startup file

2000-07-24 Thread David Hodgkinson


Paul Phillips <[EMAIL PROTECTED]> writes:

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

Yes. But you need to use Apache::RegistryLoader to load the script.

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



Re: Apache::Session and blessed references

2000-07-24 Thread Dylan Weed


Hi Jeffrey --

I'm pretty sure the problem is reproducible, but I'll rerun the dog 
test case tomorrow when I get a chance and let you know whether
things are still broken.  I'll also flesh it out into a complete program.

One unique thing about our configuration is that we're using Apache
1.3.12/mod_perl 1.24/Perl 5.6.0.  (We're also running under Linux and
using mysql locking if it matters.)  We're running Perl 5.6 because we
want to avoid the dying-in-an-eval bug in 5.005, but I can't say that I
trust 5.6 entirely -- it seems to still have a few nasty bugs.  Were you
running your latest tests under 5.6?  And do you think it's possible that
the bug might be a 5.6/Apache::Session interaction?

I'll write again tomorrow with more info.

Thanks,

 -- Dylan

On Sun, 23 Jul 2000, Jeffrey W. Baker wrote:

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




HTTP_COOKIE value sometimes corrupted.

2000-07-24 Thread AAron

Hello gurus in mod_perl land!
mod_perl is a great extension to apache!
I just wish it were easier to config & install.
Touching an Apache/mod_perl installation that already works is just
about the only thing that scares me these days.

As for my problem...

Hardware: Dual processor PIII 500Mhz, 512Meg
Software: modperl/1.21, Apache/1.3.6, RedHat/6.1
mod_perl build flags: ?? (I don't know how to determine what they were)

I've got a site that uses a cookie to determine the user's identity and
session. I noticed that after bouncing quickly around the site has
started driving me to the login page for the site. This shouldn't happen
because the session I've got is "fresh" (it should become invalid only
after a month). I tracked the sporadic problem down to the HTTP_COOKIE
value being corrupted from time to time. All the other environment
variables are exactly the same as they should be between page loads, but
the HTTP_COOKIE value sometimes ends up with random junk in the 4
characters starting at position 22 (where 1 is the first character in
the string). It's always those 4 that get corrupted! I've seen them be
printable text, and binary characters.

Actually the PATH variable is somewhat corrupted as well. It's correct
on the first hit to an agent, but ALWAYS bad after that. I noticed some
posts about this problem.

The HTTP_COOKIE problem is difficult to produce, but does repeat more
often after the first occurance. Changing the url in my browser to load
a different CGI seems to affect how often the problem arrives, so it's
been difficult to document. I tried hitting a really small sample
program, but I can't catch the problem there when the problem is
happening somewhere else.

My code does not change the values within %ENV. To see the details of
the problem I dumped the contents of %ENV to a file and started jumping
between two web pages with reasonable speed (extreme speed not
required). After it starts, even waiting for a while does not make the
problem go away.

Here's how I dumped the values for seeing that the HTTP_COOKIE value was
not right:
my ($k, $v);
open (SAV, ">>/tmp/sav.out");
while (($k, $v) = each %ENV) {
print SAV "$k = $v\n";
}
close(SAV);

Here's the HTTP_COOKIE entries on subsequent page hits (no changes
should have occurred):

This is correct:
HTTP_COOKIE =
i=i%3DT%26s%3DaaQBS8Wuasaaul%252F12i3u%26devunlock%3D1234%26e%3Daaronn%2540questra.com

These are incorrect (notice the 4 chars starting at position 22 are
different):
HTTP_COOKIE =
i=i%3DT%26s%3DaaQBS8Woutiaul%252F12i3u%26devunlock%3D1234%26e%3Daaronn%2540questra.com

HTTP_COOKIE =
i=i%3DT%26s%3DaaQBS8Wä~I¦Íaul%252F12i3u%26devunlock%3D6069%26e%3Daaronn%2540questra.com

HTTP_COOKIE =
i=i%3DT%26s%3DaaQBS8W>