[newbie] [mp2] when are inline/anonymous subs compiled?

2005-03-09 Thread John ORourke
Hi folks, apologies if this is well known information, I did search! My response method-handler reads a template and I want to call a different sub for each type of 'field' I find. I also want other packages to be able to 'register' new subs for new 'field' types. I'm not sure wether to use a ha

[ap2/mp2] post-processing handler output with another module (php)

2005-03-13 Thread John ORourke
Hi, I'm sure I should know this, but I'm trying to post-process the output of my handler with PHP. I'm still a bit green on Apache inner workings and just can't make it happen. I've made sure the php LoadModule statement is before the Perl one in httpd.conf. I've tried using a URI which ends in

RE: [ap2/mp2] post-processing handler output with another module (php)

2005-03-13 Thread John ORourke
- From: Matthew Westcott [mailto:[EMAIL PROTECTED] Sent: 13 March 2005 15:27 On 13 Mar 2005, at 14:20, John ORourke wrote: > > I'm sure I should know this, but I'm trying to post-process the output > > of my > > handler with PHP. I'm still a bit green on A

Apache2::Cookie odd return values

2005-08-02 Thread John ORourke
(apologies if you get this twice) (mp 2.0.1, libapreq2-2.06-dev, httpd 2.0.51, Fedora Core 2) Hi folks, I've spent 2 days trying simply to read and write cookies! Just before I pack it in and become a paper boy, can anyone help? If you haven't time to read below but have some working cookie re

Apache2::Cookie odd return values

2005-08-02 Thread John ORourke
(mp 2.0.1, libapreq2-2.06-dev, httpd 2.0.51, Fedora Core 2) Hi folks, I've spent 2 days trying simply to read and write cookies! Just before I pack it in and become a paper boy, can anyone help? If you haven't time to read below but have some working cookie read/write freeze/thaw code or UR

MP2 easy cookie interface available

2005-08-23 Thread John ORourke
Hi folks, I found the available cookie methods a bit tricky to use (I think the blessed scalars or overloading were confusing me!), so I wrote a simple cookie interface to use in place of Apache2::Cookie. Most of the code is copied from that. I haven't got time to CPAN-ify it at the mo, but

Re: MP2 easy cookie interface available

2005-08-23 Thread John ORourke
Sounds great, it'd be a nice addition to Apache2::Cookie. Getting the secret through to freeze and thaw is the tricky bit - I guess it could just be supplied to fetch() and new(). There are a couple of extras that I'm adding: - a delete method which deletes the cookie by name (ie. you don't ha

Re: MP2 easy cookie interface available

2005-08-23 Thread John ORourke
#x27;t looked at it that closely. The bigest thing I would say is you should subclass perhaps APR::Request::Cookie instead as that is the API we recommend these days. John ORourke wrote: http://www.versatilia.com/downloads/Validated.pm

Re: Apache2::Cookie blank value bug?

2005-08-25 Thread John ORourke
No solution but a work-around is to set the value to something and set -expires=>0, which should delete the cookie from the browser. Blank values are contrary to the RFC anyway so you probably shouldn't be trying to use them. cheers John Ted wrote: Blank value in cookie causes server to d

Re: mod_perl2 custom form handler and Motorola i530 phone

2005-08-27 Thread John ORourke
I've had a little experience with mini-browsers... the simple view is that it works on (presumably) quite a few other browsers (tried other phones?), therefore it's likely a Motorola bug - they're not well known for functional phone interfaces are they :) The goal for small browsers is a small

Re: survey

2005-08-27 Thread John ORourke
Randal L. Schwartz wrote: Adam> The people that are actually using mod_perl to any real degree Adam> probably don't have it in their servers headers (as you said Adam> before Perrin). Harmful, in that when a PHB reads "Perl is dead, PHP roxors!" as stated by otherwise knowlegable sources, we

Re: Problem with french accents using mod perl

2005-09-08 Thread John ORourke
David Scott wrote: Um, guys, whatever happened to character entities for non-US ASCII characters (eg é for e-accent-aigu)? Seems to me it would be easy to write a filter to replace outgoing characters with their character entity equivalents, thereby avoiding character set issues. d Yeah I

Re: Code Refs

2005-09-16 Thread John ORourke
Anthony Gardner wrote: and I need a code ref. The thing is, I can't make a code ref out of $self->method_to_invoke( $arg1, $arg2 ); I'm going to get into trouble for stating the obvious here but have you tried: $code_ref = sub { return shift->method_to_invoke( @_ ) } (ie. create a n

Re: Code Refs [OT]

2005-09-16 Thread John ORourke
s s.o. can point me to the right place. Thanks for the tip and any more info on what is actually happening when we invoke sub{} would be great. -Ants --- John ORourke <[EMAIL PROTECTED]> wrote: Anthony Gardner wrote: and I need a code ref. The thing is, I can&#

Apache2::SOAP newbie

2005-09-22 Thread John ORourke
A little OT, but has anyone got any experience or examples that use Apache2::SOAP or some other means to create a mod_perl SOAP server? I'm rushing headlong into SOAP development and (as one does) tackled something nice and big for my first project - a Perl SOAP server that receives and sends

Re: Apache2::SOAP newbie

2005-09-23 Thread John ORourke
Thanks Foo, I've now got my Apache2::SOAP-based server talking with C#.NET clients, and auto-generating the WSDL using Pod::WSDL when they call http://url?wsdl, which is nice! I'm now finding out about all the SOAP::Lite overrides and methods I can use to return a .NET DataSet object to the

Re: API to mime.types?

2005-09-23 Thread John ORourke
You can use Apache to do it but it's probably less efficient: $lookup=$r->lookup_file($fullPathAndFilename); $mime_type=$lookup->content_type(); but that does a full subrequest to my knowledge. I'd recommend a perl module that emulates the 'file' command: use File::MimeInfo::Magic; $mime_typ

Re: API to mime.types?

2005-09-23 Thread John ORourke
Ah yes, Jeff ignore my suggestions and use Geoff's! Geoffrey Young wrote: http://search.cpan.org/dist/File-MMagic-XS/

Re: Off Topic - Apache::Session::MySQL and invalid Session IDs

2005-10-18 Thread John ORourke
Hi Jonathan, I don't know the Session:: stuff but it sounds like something I did with DBI - I use persistent handlers so I needed my own custom version of Apache2::DBI. Why not subclass Session::MySQL and have the new() (or equivalent) method do your validation on the handle before calling $

[OT] Re: a new mod_perl problem

2005-10-18 Thread John ORourke
Angel Flower, 'my' means that it is local to the main program, so your subroutine won't see that version of "$counter". Your subroutine will create and access a global version of "$counter" which is separate and doesn't get re-initialised. You need to read up on 'my' and references - do "man perl

Re: [OT] Re: a new mod_perl problem

2005-10-18 Thread John ORourke
Perrin Harkins wrote: Good guess, but that's not what is happening here. What our flowery friend has stumbled onto is a closure. When a subroutine references a "my" variable that was declared outside of that subroutine's scope, the sub will keep a private copy of that variable. If it wasn't

Re: Authentication

2005-11-10 Thread John ORourke
Martin, You can avoid some redirection by having a non-HTTPS form which submits to the HTTPS login page (although users might worry, no padlock icon). Otherwise it's perfectly reasonable to redirect to a secure login. On successful login simple 403 the user back to the page they wanted. Th

Re: Authentication

2005-11-10 Thread John ORourke
My fault guys, not looking up the numbers - Martin is your admin complaining about too many FORBIDDENs or REDIRECTs? The only thing I can add is that I'd recommend not using the authentication pages/handler to redirect - make yourself an Access phase (eg. "if no valid cookie, redirect to HTTPS

Re: Authentication

2005-11-10 Thread John ORourke
Hi Marty, I must be missing something here... If I understand, you're timing out a login but if it does time out, you're automatically re-authenticating without user interaction? Why not just take away the login timeout or make it longer? John Martin Moss wrote: I'll have a think about i

pnotes preserved accross calls?!

2005-12-19 Thread John ORourke
Hi perlites, I'm getting my brain twisted here... [FYI: Apache 2.0.51, MP 2.0.1, Linux 2.6.5] still debugging but it *seems* like $r->pnotes is being preserved between requests (I'm storing a hash ref in it like this: $r->pnotes('cookies',$cookie_hash) Are there any circumstances where pnote

Re: pnotes preserved accross calls?!

2005-12-19 Thread John ORourke
Quite right Tom... I think I found the problem anyway, it appears to work fine now - see below, I've collapsed a few function calls to make it clearer but you'll see what silliness was going on... I'm using method handlers and the object is preserved between requests, like so: package Data

Re: Going mod_perl hourly rate?

2005-12-20 Thread John ORourke
I don't know what US rates are like but I'd suggest taking into account these: + mod_perl is a rare skill in a world full of php 'coders' + mod_perl can bring commercial benefits (cheaper hardware, faster sites etc) - mod_perl is more expensive to maintain because it's harder to find people wh

Re: MIME::Lite / mod_perl2 segfault

2005-12-21 Thread John ORourke
Dunno if this'll help but a couple of points: 1 - why use instead of in httpd.conf? 2 - I successfully upgraded Apache and mod_perl without too much trouble, there were many bug fixes between 1.99* and 2.0.1. Well worth it. 3 - I'm "use"ing MIME::Lite 3.01 on mod_perl 2.0.1, httpd 2.0.51, Per

[OT] Re: modifying the query string & uri without a redirect ?

2005-12-24 Thread John ORourke
I'll give you the mod_rewrite solution but a mod_perl handler version is similarly simple. RewriteRule /user/(.+)(/profile)? /user/profile?id=$1 [NS] This creates an internal subrequest (ie. users don't see it) for the new URI, and if I remember rightly mod_rewrite will sort out your query st

Re: my last url rewriting question (hopefully)

2005-12-29 Thread John ORourke
Don't forget (depending on your config) your mod_perl handler will be called twice, once to handle the original request and once to handle the subrequest, so in your handler you should return Apache2::Const::DECLINED unless the URI is in the right format. Why not forget the rewriting and just

mod_perl/Perl/SOAP/XML opportunities in UK

2006-01-05 Thread John ORourke
This is a rare skill set to see on a job spec so I thought I'd post it to the list, might be useful to someone... Original Message Subject:Perl Opportunities Date: Thu, 5 Jan 2006 12:13:40 - From: Kerry Woods <[EMAIL PROTECTED]> To: '[EMAIL PROTECTED]' <[EMA

Re: [MP2] possible pnotes bug?

2006-01-09 Thread John ORourke
Torsten wasn't changing the value pointed to by $ctx, he was changing $ctx - therefore it looks like pnotes actually stores a reference to the scalar you give it, instead of the actual scalar itself as the docs imply. So I'd say it's a doc bug, but I'd prefer pnotes to store the actual scalar

Re: making versioned libraries work on the same server

2006-01-11 Thread John ORourke
You could check %INC to see exactly which file it's including: -- use MyLib::X; warn "Using MyLib::X from $INC{'MyLib/X.pm'}\n"; -- John Daniel McBrearty wrote: Hi, If I am developing an app that has a bunch of perl modules as part of the repository (the modules are dedicated for this

Re: -M in modperl

2006-01-12 Thread John ORourke
Luke, the values you are sorting are the just filenames, so you must prefix the full path, like this: my $path='/path/'; # important to use trailing slash opendir( DIR, $path ); my @dots = grep(/recovery/,sort { -M $path.$a <=> -M $path.$b } readdir(DIR)); closedir(DIR); When you ran it before

Re: Newbie (kind of) help with getting apache setup for certain file endings

2006-01-16 Thread John ORourke
Hi Paul, welcome back to quality regex handling... IMHO you've got 2 options - do it the restrictive way: SetHandler perl-script PerlHandler My::Module Or do it the easy/flexible way - have your module(s) decline URIs which they don't want to handle: sub handler { my

tracing module references for clean destruction

2006-01-16 Thread John ORourke
Hi folks, this is partly relevant to the recent DBI discussions but I'm wondering about the best way to track and correctly destroy my references. My mod_perl system involves 70+ modules and 20K lines of code (why God why?!!), and I've ended up having to have called methods refer back to the m

Re: [OT]Re: RegEx Hell

2006-01-31 Thread John ORourke
or $bla=~/([^\/]+)$/; in case the filenames have non-alpha chars or more dots... Tom Schindl wrote: on the other hand: my $bla = "/dir/subdir/file.ext"; $bla =~ /(\w+\.\w+)$/; print $1 . "\n"; # file.ext works perfectly

Re: hardware prerequisite

2006-02-02 Thread John ORourke
There's some good performance advice on perl.apache.org: http://perl.apache.org/docs/general/hardware/hardware.html#Memory Use top or ps to look at the size of the httpd processes - the memory used by the individual process is 'RSS' minus 'SHARE'. The more modules you load, objects you create

Re: Usage suggestions: caching DB metadata with mod_perl?

2006-02-04 Thread John ORourke
Jonathan's right, the overhead of caching data shared between apache processes is probably more than a DB call using a cached DBI handle. For multi page forms I just keep it all in hidden form fields between pages, validating as we go, then revalidate all the fields before finally comitting to

Re: [MP2] set breakpoint

2006-02-07 Thread John ORourke
What sort of IDE, debugger, and platform are you using? Personally for debugging handlers I find it easier to just stick a line like: warn "got here, r=$r\n" then just tail -f the error_log. Proper old school. Then again I develop with vi on an 80x24 terminal, am I missing out on something?

Re: [MP2] set breakpoint

2006-02-07 Thread John ORourke
, John ORourke <[EMAIL PROTECTED]> wrote: What sort of IDE, debugger, and platform are you using?

Re: odd bug - script not executed only when passed certain argument

2006-02-07 Thread John ORourke
If it's a late night thing you'll be needing suggestions... - do ?lang=jp right after restarting the server - do ?lang=xx where xx is some random (invalid) combination of letters - clarify "does not run" - does not produce expected output? crashes? does not execute a certain bit of your code? - m

Re: mod_perl 2 newbie

2006-02-07 Thread John ORourke
I don't know about a manual build but some installs put the perl stuff in file(s) in /usr/local/apache2/conf.d/, so it may not be mentioned in httpd.conf. JupiterHost.Net wrote: grep -i perl /usr/local/apache2/conf/httpd.conf have no output. So how do I tell if mod_perl 2 is compiled into

Re: the modperl book link is broken

2006-02-08 Thread John ORourke
Both links work for me... Ken Perl wrote: their links http://modperlbook.org/ and http://www.modperlcookbook.org/ are both broken now, Does anyone have these two ebooks? ps. the sig separator should be dash-dash-space ;)

Re: FW: MP2 PerlTransHandler and VirtualHosts

2006-02-15 Thread John ORourke
Wouldn't PerlTransHandler Apache2::Const::DECLINED be better in this case, so it will fall through to the default handler? Fred Moyer wrote: Very odd. Anyone know if 'default-handler' isn't in MP2? I can't say that it isn't, but maybe this will work: PerlTransHandler Apache2::Const::O

Re: A question for the newbies

2006-02-16 Thread John ORourke
Well I'm more of an old-bie, but I've heard quite a few people recently (first hand) acknowledging that PHP (specifically) isn't really a 'serious' contender for enterprise web apps. (no flames please, I have no opinions!) I've also noticed my favourite news site* defining 'LAMP' as "Linux,

Re: A question for the newbies

2006-02-16 Thread John ORourke
This thread has brought out some quite interesting marketing (as in advocacy and understanding) issues so far - any volunteers for adding to or creating a FAQ about getting into mod_perl? John

performance/use of push_handlers over static config

2006-04-02 Thread John ORourke
Hi folks, I'm looking to improve a pretty large mod_perl app I have, which currently uses statically configured method handlers like so: httpd.conf: PerlModule My::Module (creates an instance of itself as $My::Module::Persistent ) PerlAccessHandler $My::Module::Persistent->acce

Re: can PerlTransHandler deal with this?

2006-05-11 Thread John ORourke
Fayland Lam wrote: let me describe my situation. we have something like http://o1.example.com/1.jpg and we have a table like: 1.jpg | o1 and now we want the people visit this by http://o.example.com/1.jpg yes, o1,o2,o3 are different servers. I'd like to config the o.example.com like PerlTrans

Re: apache url mapping question

2006-05-17 Thread John ORourke
Hi Jonathan, two examples which I think are right, comments please folks! Jonathan Vanasco wrote: i need to get the following urls mapped onto a handler in httpd.conf / /index /index.* Option 1: SetHandler perl-script PerlResponseHandler My::Module Option 2:

Re: $c->remote_ip

2006-05-22 Thread John ORourke
Jonathan wrote: testing on my local mac network @home, its giving me addresses like such: fe81::2333:25ee:ffb2:b244 It's certainly an IPv6 address - 128 bits, and "::" means 'the longest set of zeroes you can fit in'. Maybe your macs are using IPv6 natively. Why is it causing a prob

Re: sharing data within a handler (but not across)

2006-05-27 Thread John ORourke
Jonathan Vanasco wrote: i specifically wanted to keep apache related stuff out of the model when designing it, but i was in the situation where i needed to access it for a quick hack ( i chose the longer elegant solution that negated touching it ) and said "hm... i wonder how could i do

logging recommendations

2006-05-30 Thread John ORourke
Hi folks, I've written a largeish (80 modules, 20k lines) mod_perl CMS and currently the logging is a mess. I've looked at a few on CPAN, noteably Log::Common, but I really want something which: - allows a single, global debugging level - does not require each module to have access to Apach

Re: logging recommendations

2006-05-30 Thread John ORourke
Thanks to everyone who replied. Log::Log4perl seems perfect and easy enough to use, especially for handling logging within a class hierarchy and centralised control, without having a bunch of references to pass around. I'm making an Apache2:: wrapper for it so I can easily config it from htt

Apache2::Log Filename(line) behaviour

2006-06-16 Thread John ORourke
Hi folks, Is there a way to log a debug-level message without Apache2::Log writing the filename and line number of the caller? Could I override something in Apache2::Log? This behaviour is documented in man Apache2::Log. I'm using Log4perl, so every debug-level message comes out with "Apac

Re: (Database-)Object initialization during server-startup

2006-06-23 Thread John ORourke
Personally I don't use Apaceh::DBI, because I have a similar situation to you. Here's how I do it, it may not be the best way but it's fairly clean. It does make a separate DB connection in each apache process but I think trying to share 1 DB connection between httpd's is probably going to co

Re: (Database-)Object initialization during server-startup

2006-06-23 Thread John ORourke
Perrin Harkins wrote: Create a new instance of the mod_perl handler module during startup and refer to that for the handlers (code below). This module would then cache DB connections and provide a method for 'create or fetch current DB connection'. DBI->connect_cached will do all of this f

out of date dependency in libapreq2?

2006-06-24 Thread John ORourke
Wrong list, I know, but I figure mod_perl people will have come accross this more than anyone. Is there any reason the CPAN Apache2::Request has a dependency on mod_perl (as opposed to mod_perl2) ? Doing a clean mp2 install I have to ensure all its other dependencies are met, then install it

Re: handlers

2006-07-31 Thread John ORourke
Vladimir S. Tikhonjuk wrote: O.K. Thanks for answer :) I want to write rather big project. How I have to construct it: I mean, should I make a lot of handlers, like, /debitor, /debitor/documents, /debitor/documents/contracts Or, create *.pl scripts. Or may be there is another theory ?

Re: handlers

2006-08-01 Thread John ORourke
Frank Maas wrote: On Tue, Aug 01, 2006 at 07:33:51AM +0100, John ORourke wrote: You could even do something really clever and make it map URI onto module - eg. so /debitor/contract/create calls Debitor::Contract->create(), but that wouldn't be very secure! Why would that be

Re: handlers

2006-08-01 Thread John ORourke
Vladimir S. Tikhonjuk wrote: John ORourke пишет: Vladimir S. Tikhonjuk wrote: O.K. Thanks for answer :) I want to write rather big project. How I have to construct it: I mean, should I make a lot of handlers, like, /debitor, /debitor/documents, /debitor/documents/contracts Or

Re: handlers [OT]

2006-08-01 Thread John ORourke
Michael Peters wrote: John ORourke wrote: You could even do something really clever and make it map URI onto module - eg. so /debitor/contract/create calls Debitor::Contract->create(), but that wouldn't be very secure! You could use something like Apache::Dispatch to achieve

Re: [OT] Database Authentication

2006-08-03 Thread John ORourke
Not exactly a mod_perl question but I'm sure it's something we've all thought about before... Vladimir S. Tikhonjuk wrote: I want to make a Database Authentication for my site. I have a PostgreSQL Database. I made a connect_on_init by user 'web_user' to the database. The question is: whe

Re: X-Forwarded-For

2006-08-03 Thread John ORourke
Jonathan Vanasco wrote: my mp2 needs to get the ip of the remote address on some installations, mp2 is on port 80 on other installations, mp2 is on 80xx and the ip is in X-Forwarded-For You could re-write the remote IP at an early stage - add a PerlFixupHandler or PerlTransHandler which goe

Re: PerlResponseHandler ignored

2006-08-04 Thread John ORourke
Cristi Barladeanu wrote: Hello, I come back with more details. This is my complete conf in Apache's sites-enabled: I can't see the problem but I would say you should probably have the "SetHandler" outside the bit - currently it doesn't look like your PerlTransHandler will run, but I

[OT?] UK mod_perl contractor/moonlighter possibly needed

2006-08-21 Thread John ORourke
Hi folks, hope this isn't too OT.. just dipping my toes in the water here. This may not happen (depends on funding) but I'd really like to know if there are any UK based mod_perl coders who are either contractors or fancy a bit of out-of-hours work, so I have a case to present to my business p

Re: dynamic loading

2006-08-21 Thread John ORourke
Arshavir Grigorian wrote: I am wondering if anyone has experience with a framework for dynamically loading certain modules into an application and executing certain code based on whether a certain module is loaded (available or not). By "dynamically", I do not mean loading run-time, only being a

Re: design patters with mod_perl

2006-09-13 Thread John ORourke
Greger, Greger wrote: Is there anything in particular that one should take into account regarding modperl and design patterns vs trad CGI-scripting? As for now, I return XML from the package methods, and use XSLT for the transformation to XHTML. This works very well, seems flexible, but are th

getting current phase / PerlOptions in

2006-10-25 Thread John ORourke
Hi folks, I can't find anything in the docs (not really sure what to look for) - I want to retrieve the current phase from within a handler. Basically I'm trying to implement a per-directory PerlOptions type directive, so I can turn phase handlers on and off per-directory not just per-server

Re: getting current phase / PerlOptions in

2006-10-25 Thread John ORourke
Thanks Adam, not sure why but I didn't look under ModPerl::Util:: Adam Prime x443 wrote: That should be ModPerl::Util::current_callback for 2.0.

Re: method handlers

2006-10-27 Thread John ORourke
Jordan McLain wrote: just noticed... in the actual code 'handler' is prototyped with ($$) sub handler { my ($class, $r) = @_; my $self = ... # something hashref-ish I will end up writing another "new()" for use when not called directly from apache. Is this bad style, since the method

MapToStorageHandler and custom config

2006-10-27 Thread John ORourke
Hi folks, I've implemented some custom config directives, works fine. However, when my MapToStorage handler asks for the per_dir_config hash, it seems to be getting the server config - all other handlers get the per-dir no problem. Any ideas? cheers John

Re: MapToStorageHandler and custom config

2006-10-28 Thread John ORourke
onto /content//some/path, so I wanted to enable/disable it in . I can tell my custom config to write config values into the server config. cheers John Geoffrey Young wrote: William A. Rowe, Jr. wrote: Fred Moyer wrote: On Fri, 27 Oct 2006, John ORourke wrote: Hi folks, I

Re: Apache2::Cookie/APR::Request::Cookie

2006-12-09 Thread John ORourke
cfaust-dougot wrote: I've tried both Apache2::Cookie and APR::Request::Cookie (from the posts I read I got the impression it was better to use ARP::Request::Cookie then Apache2::Cookie). Definitely. You also need to read the man pages, but I've saved you the trouble... $r->err_headers_out->

Re: Apache2::Cookie/APR::Request::Cookie

2006-12-09 Thread John ORourke
Ummm... this should be obvious but are you redirecting to a different hostname? In your code you're not explicitly setting the cookie domain or path, so the browser will only send the cookie to pages with the same hostname. That would explain why you don't see it on the redirect... Note tha

Re: Apache2::Cookie/APR::Request::Cookie

2006-12-09 Thread John ORourke
cfaust-dougot wrote: I'm always passing a relitive path to "Location" so I didn't think it would matter.. Sure enough once I simply added 'Path => '/'," to all my cookie create statements, SUCCESS!!! Yay! Has to be said I only thought of the hostname because I do the path out of habit! By th

Re: The case of the disappearing plus sign

2006-12-18 Thread John ORourke
I wouldn't really call this a modperl question but regardless... Chris Schults wrote: It appears that the "+" is getting stripped out at some point as the script is returning results for "water pollution" instead of "water+pollution". Is it possible that Apache is the culprit or should we be loo

database caching in persistent handlers

2007-01-15 Thread John ORourke
Hi folks, please humour me with this slightly OT RFC... So I've re-invented the wheel (or MVC framework) and need to make it efficient. A high-traffic site is using the system and is causing me some grief... Some questions have come up re efficient caching: - MySQL caches compiled statement

Re: database caching in persistent handlers

2007-01-15 Thread John ORourke
Perrin Harkins wrote: On Mon, 2007-01-15 at 13:02 -0600, Frank Wiles wrote: Not being a MySQL guy this could be fixed now, but last I heard MySQL tossed it's cache anytime the table was updated. Not very efficient IMHO. Yes, modifying data in a table invalidates the cache fo

apache MaxClients and locking up

2007-02-08 Thread John ORourke
Hi folks, Not sure if this is mod_perl related but the logic goes I've never had this issue on a non-mod_perl server... I've got a busy server with quite a few problems, but one in particular is very odd. Occasionally the DB gets a bit bogged down and starts taking a while to respond (opti

Re: apache MaxClients and locking up

2007-02-09 Thread John ORourke
Thanks for all the advice guys - due to pressure from the customer I'm going to concentrate on optimising the app and then look into the server optimisations. It's suffering from inner-platform-effect at the moment (http://thedailywtf.com/forums/69415/ShowPost.aspx ) so the DB is doing way too

Re: Server Side Image Maps & libapreq / cgi

2007-02-20 Thread John ORourke
Hi Jonathan, Jonathan Vanasco wrote: I've got a question about Server Side image maps I'm sure you're aware of the accessibility implications of server-side image maps and you have a valid reason for using these travesties of useability, so... How can I reliably catch this under libapreq

Re: 'current server directory' ?

2007-02-20 Thread John ORourke
Jonathan Vanasco wrote: I'm trying to figure out a way to store them in a semi-standard manner. The only thing i can think of right now, is writing a 'server root' variable for the dir in which I am installing my mp app, and reading it based on that. Not sure if this'll help but for virtual-se

Re: 'current server directory' ?

2007-02-20 Thread John ORourke
I just realised you're talking per-real-server not per-virtual-server, in which case you could make a custom directive or a PerlSetVar outside of a . The custom config directives take a bit of time to figure out but I'm happy to send source code off list. cheers John Jonathan Vanasco wrote:

Re: 'current server directory' ?

2007-02-20 Thread John ORourke
No problem Lin - I'll post a URL soon! Lin wrote: Hi John, The custom config directives take a bit of time to figure out but I'm happy to send source code off list. Why not in-list? I'm interested and there might be others. Cheers, Lin

Re: SOAP

2007-03-01 Thread John ORourke
Martin Moss wrote: It's been a while since I've posted, but I have a new project which has a SOAP interface. I have limited experience with SOAP, so I was wondering if there is a consensus of opinion as to what the best modules to use are? I'm with Perrin, SOAP::Lite is the one. I've successf

Re: Generating login forms from authen handler?

2007-03-08 Thread John ORourke
Hadmut Danisch wrote: how would I generate a web page (i.e. a login form) from a authen handler in the case that the user is not authenticated yet ? Can the authen handler generate HTML code and pass it back to the client as an immediate reply? The authen handler can simply return the right

Re: Generating login forms from authen handler?

2007-03-08 Thread John ORourke
I am currently doing something similiar, I just modify the URL to that of the script to be called. But I need to generate the HTML code from *within* the authen handler (needs dynamic generation etc.). Ah I see - probably best not to output stuff at that stage as it could confuse the

Re: [OT] SOAP::Lite help

2007-03-13 Thread John ORourke
Not really mod_perl but possibly of interest - here's my version, untested: #!/usr/bin/perl use SOAP::Lite +trace; use Data::Dumper; $soapobj=SOAP::Lite->service('https://myserver.myhost.com/services/EndUser?wsdl'); $soapresult=$soapobj->getUser('wombat104'); if($soapresult->fault){ print "FAU

Apache2::ServerUtil set_handlers/push_handlers query

2007-03-18 Thread John ORourke
Hi folks, I might be having a blind moment, this is probably in the docs but please pity the stressed coder... q1) can I put multiple handlers in a call, like: push_handlers( PerlAccessHandler=>\&access, PerlAuthenHandler=>\&authen ) ? q2) when set_handler is called, it's only setting the

Re: regex quickie

2007-04-26 Thread John ORourke
Come on people, someone's gotta do this for a laugh... &{"do_".lc(($r->uri()=~/(\w+)\.com\//i))}(); sub AUTOLOAD { return undef; } sub do_google { } sub do_yahoo { } Yeah so I'm bored and ready for home... John

Apache::DProf - can tmon.out files be merged?

2007-05-07 Thread John ORourke
Hi folks, I just discovered Frank's article on debugging mod_perl... man have I been coding in the dark ages! I need to run it on a production server and can't keep the no. of children at 1, so does anyone know if the tmon.out files from all the apache children can be merged somehow? It lo

merging multiple tmon.out files

2007-05-11 Thread John ORourke
Hi folks, Recently I needed to track down some slow page-load times on a production server, so I took the performance hit and stuck Devel::DProf on it for a few hours, but then had to get an overall picture. So I wrote a little script to merge multiple tmon.out files - help yourselves: htt

Apache::DProf missing some subroutines

2007-05-11 Thread John ORourke
Hi folks, Any idea why Apache::DProf would be failing to list some subroutines that are definitely being called, in the tmon.out file? I grepped all sub references from tmon.out and it's listing my method handlers, it's listing some of my constructors, and its listing some object methods, bu

Re: Apache::DProf missing some subroutines

2007-05-11 Thread John ORourke
Geoffrey Young wrote: Jeff wrote: Not sure if its relevant, but from general Perl usage, Devel::Profiler often fails to properly recognise function names if its USE statement ends up being executed before your classes have been USEd. yes, because Devel::Profiler scans for then during it

Re: Apache::DProf missing some subroutines

2007-05-11 Thread John ORourke
Perrin Harkins wrote: On 5/11/07, John ORourke <[EMAIL PROTECTED]> wrote: Any idea why Apache::DProf would be failing to list some subroutines that are definitely being called, in the tmon.out file? Yes. You're probably loading some of your code before initializing the deb

Re: Module proposal: CGI::Cookie::Protected

2007-05-24 Thread John ORourke
Check out a similar module I wrote last year for mod_perl: http://www.versatilia.com/downloads/Apache2/Cookie/Validated.pm It's designed to store simple hashes. I still haven't got around to putting it on CPAN but have been using it happily for 18 months and it has a couple of features you mig

mod_perl, html forms and unicode/utf-8

2007-06-05 Thread John ORourke
Hi folks, I've been dragged kicking and screaming into the 21st century and am making my mod_perl application fully utf-8 aware and transparent. It's all going OK but I want to know if anyone has a better solution to receiving form data containing non-ASCII chars. Output is fine - I can ove

Re: mod_perl, html forms and unicode/utf-8

2007-06-05 Thread John ORourke
Thanks Gents, I've got a certain level of abstraction as per Jonathan's approach, which I can just add the libapreq method. The note about DBD::MySQL is interesting, I was wondering about that! cheers John Clinton Gormley wrote: Hi John I've been using libapreq, which has a charset method

APR::Request::Param subclassing

2007-06-08 Thread John ORourke
Hi, I know this isn't the apreq list but I don't suppose anyone has an example of subclassing APR::Request::Param? I'm trying this: package My::Handler; sub handler { ... my $query=Apache2::Request->new(); my $params=$query->param(); $params->param_class('My::Param::UTF8'); .

  1   2   >