RE: AUTOLOAD in mod_perl (was Re: When perl is not quite fastenough)

2002-12-17 Thread Ben Mathews
There is a number of modules on CPAN that already do similar things

Ben


 -Original Message-
 From: Christopher Grau [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, December 17, 2002 12:05 PM
 To: [EMAIL PROTECTED]
 Subject: Re: AUTOLOAD in mod_perl (was Re: When perl is not quite
 fastenough)
 
 I may be veering off-topic, but I've started doing similar things in
my
 own code (generating accessor methods via AUTOLOAD).  I ended up
writing
 `Class::Autoload,' which I intend to upload to CPAN when I'm done with
 documentation and testing.
 
 Basically, it exports an AUTOLOAD function that will work with the
 %FIELDS hash to insert accessor methods into the symbol table as
 needed.  There's also a compile() method that can be used to
precompile
 the methods, which I thought was relevent, given the mod_perl/memory
 discussion.  It also provides for read-only methods, and a typing
system
 like that of `Class::Class.'
 
 If there's interest, I'll clutter up the list some more with the POD.
 
 On Tue, 2002-12-17 at 11:13, kyle dawkins wrote:
  Perrin (et al... cc'ing this back to the list)
 
  Thanks for this information... it is confirming what I originally
  thought, so I don't need to change my code (yet).  But I wanted to
post
  it back to the list to everyone else can benefit from it.
 
  I personally tend to avoid AUTOLOAD, only because it is a piece of
perl
  magic that can be super-confusing to developers coming to perl
(and
  mod_perl) from other languages (um, Java) and I think there's a
  voodoo-level involved that's a bit high for my tastes.  In the one
  place I use it, I don't generate anything, just trap calls to
methods
  with AUTOLOAD and perform a lookup based on the arguments.  If it
  really is that slow, maybe I'll even rewrite that to use something
  other than AUTOLOAD.
 
  Cheers!
 
  Kyle Dawkins
  Central Park Software
 
 
  On Tuesday, Dec 17, 2002, at 13:13 US/Eastern, Perrin Harkins wrote:
 
   kyle dawkins wrote:
   Sorry to mail you directly... can you just give me two cents on
your
   comment below about AUTOLOAD, mod_perl and memory sharing?   I
use
   AUTOLOAD in one module to perform accessors and I wonder if
there's a
   better way to save memory.
  
   AUTOLOAD is kind of slow, so most people put something in there to
   define their accessors as subs by manipulating the symbol table.
It's
   easy, and Damian's book has an example.
  
   In mod_perl, you want any methods that you expect to be called to
be
   defined in the parent process so they will be shared.  I do this
by
   building all of the accessors in a BEGIN block in my module which
is
   called when I use it in startup.pl.
  
   - Perrin
  






RE: [OT] Stack Operation

2002-11-23 Thread Ben Mathews
Don't reinvent the wheel.

http://search.cpan.org/search?query=stackmode=module

Ben


 -Original Message-
 From: Jonathan M. Hollin [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, November 23, 2002 6:59 AM
 To: [EMAIL PROTECTED]
 Subject: [OT] Stack Operation
 
 Can anyone offer me some pointers (pun intended) on how to implement a
 stack in Perl with an array?
 
 I need to have an array of elements as follows:
 
 0 - e1
 1 - e2
 2 - e3
 ...
 
 And I need to be able to insert items:
 
 e4 needs to go into $array[1].  1 and 2 need to move down (or up or
left
 or right - depending on how you visualise arrays) yet retain their
 contents:
 
 0 - e1
 1 - e4
 2 - e2
 3 - e3
 ...
 
 And, you guessed it, I need to be able to remove elements, and have
the
 others move down...
 
 remove e2, leaving:
 
 0 - e1
 1 - e4
 3 - e3
 ...
 
 How do I implement this in code anyone?
 
 
 --
 Jonathan M. Hollin
 
 Technical Director:  Digital-Word Co. (http://digital-word.com/)
 Co-ordinator:  WYPUG (http://wypug.pm.org/)
 






RE: figures/resources on content via apache SSI vs. database-driven (perl DBI)

2002-10-08 Thread Ben Mathews

Template Toolkit is what I am familiar with and while I don't have any
numbers, I would think the caching that it provides for you would win
out over processing the page every request.  Once the page has been
created, it shouldn't need any more processing until it is changed.

Look at Apache::Template and Template

Mason provides caching also.

Ben


-Original Message-
From: grant stevens [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, October 08, 2002 5:34 PM
To: [EMAIL PROTECTED]
Subject: figures/resources on content via apache SSI vs. database-driven
(perl DBI)

all-

Perhaps I am making a mistaken assumption, but just in case I wanted to 
support my assumptions with some real data.

Can anyone point me to some script resources, or maybe just the results
of 
their own experience on the performance of SSIs in apache vs. converting
a 
site to a database-driven scenario.

My assumption is, of course, that if the requirements are simple, go
with 
the simplest solution.  Basically, I broke the site up into includes 
executed via SSI.

My question would be, is there any drastic improvement (CPU, memory, 
download time, server processes, whatever)  that would be gained by 
switching to some kind of mod_perl templating system?

These are all static pages.

I think all I'm asking about is a performance comparison for a  site 
comprised of  95% static content between Apache SSI and a mod_perl 
db/template system.

thanks-
grant stevens
http://l-eet.com

PS.  RTFM answers are fine as long as the particular FM is specified. :)





RE: install/config mod_perl-2(1.99_08)

2002-10-03 Thread Ben Mathews

You say eventually perl 5.8 will be recommended.  Why is it not the
recommended version now?  

I am developing a windows application currently and started out with
activestate perl 5.6.1, apache 2, and mod_perl 1.99.  I ran into a lot
of problems and blamed them on mod_perl because it is still rather new.
Things have progressed smoothly enough using apache versions 1.x and
mod_perl 1.x

I didn't think of trying perl 5.8, but would be glad to if that is going
to help things.  I would like the capabilities that Apache and mod_perl
2.x give.

Ben


-Original Message-
From: Randy Kobes [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, October 03, 2002 8:30 AM
To: Paul Simon
Cc: [EMAIL PROTECTED]
Subject: Re: install/config mod_perl-2(1.99_08)

Maybe not easy :) Using perl-5.6.1, and Apache-2.0.42, I found
the above to also hang ... However, it worked as expected using
the perl-5.8/Apache2 binary of perl-5.8-win32-bin.tar.gz under
ftp://theoryx5.uwinnipeg.ca/pub/other/. As there's issues with
threads on Win32 with perl-5.6.1, eventually perl-5.8 will be the
recommended Win32 Perl for mod_perl-2; if possible, you may want
to give this a try.

-- 
best regards,
randy kobes





can't restart server

2002-09-06 Thread Ben Mathews

I'm running mod_perl on windows (Apache/2.0.40 (Win32)
mod_perl/1.99_05-dev Perl/v5.6.1) and it refuses to restart or stop the
service.  If I try, the system will eventually give me the blue screen
of death and crash.

Has anyone had a similar experience or know the solution?