Re: [OT] ideas on design of a diff monitor
Nick Tonkin <[EMAIL PROTECTED]> writes: > Hi all, > > I'm working on a tool that should compare two versions of a file (usually, > a web page) and report the _number_ of changes from one to the other. I've > played with Algorithm::Diff as well as standard diff and haven't found a > really sane way to "count" changes. > > With Algorithm::Diff the output appears to be too granular: if I add five > words onto a sentence it counts five changes, when it surely "is" only one > ... Wow, this really is OT, but what the hey, it's Friday. There is no way that what you've described is going to work. If I add a word to a sentence on Monday and a second word on Tuesday, there have been two changes. From your description, your ultimate solution would report one change when there have been two. The only way to get what you want is with version control software. You can write your own, but I'd recommend CVS (www.cvshome.org). > > And diff combines all changes on one line into "one," afaics ... > > Has anyone tackled this issue before? > > Thanks, > > ~~~ > Nick Tonkin
Re: mod_perl and 700k files...
On Wed, 9 May 2001, Morbus Iff wrote: > Hey there, wondering if anyone could help me with this. > > I'm relatively new to mod_perl... I've got a 700k file that is loaded each > time I run a CGI script, so I'm hoping to cache the file using mod_perl > somehow. The file will change occasionally (maybe once a week) - the reload > of a few seconds isn't worrisome, but it has to be done without restarting > the server. > > Any suggestions on exactly the best way to do this? I've going to: > > - PerlSetupEnv Off > - PerlModule and PerlRequre > - Remove buffering. > - Cache from XML::Simple ** > > ** The 700k file is an XML file, read in by XML::Simple. XML::Simple can > cache that file into memory. Is this how I should do it? Or should I load > the file from my startup.pl script so that the file is shared amongst all > the apache children? If that's the case, how would I dynamically reload it? Boy you sure got some complex answers... I store a .stor file which is a storable dump of my XML tree. I check the mtime of that against the mtime of the .xml file. Whichever is newer I load that. Works fast and is very simple. -- /||** Founder and CTO ** ** http://axkit.com/ ** //||** AxKit.com Ltd ** ** XML Application Serving ** // ||** http://axkit.org ** ** XSLT, XPathScript, XSP ** // \\| // ** mod_perl news and resources: http://take23.org ** \\// //\\ // \\
[OT] ideas on design of a diff monitor
Hi all, I'm working on a tool that should compare two versions of a file (usually, a web page) and report the _number_ of changes from one to the other. I've played with Algorithm::Diff as well as standard diff and haven't found a really sane way to "count" changes. With Algorithm::Diff the output appears to be too granular: if I add five words onto a sentence it counts five changes, when it surely "is" only one ... And diff combines all changes on one line into "one," afaics ... Has anyone tackled this issue before? Thanks, ~~~ Nick Tonkin
Re: modify Server header via a handler
On Tue, 8 May 2001, Doug MacEachern wrote: > On Wed, 2 May 2001, Matt Sergeant wrote: > > > Right, but the problem is you can't do this after module initialization > > (which is where mod_perl adds it's bits), but the PerlModule's are loaded > > after that time, so you can't do it from Perl, at least not without a > > major re-design of the mod_perl internals. You can't even do it from XS > > loaded from Perl, because of that reason. > > wha? major re-design?? PerlModules are loaded during module init. > with this patch, i can call this from startup.pl: > Apache::add_version_component("Foo/1.1"); Hmm, my experiments with an almost exact same patch (but localised into AxKit) didn't work when called from the BEGIN block in AxKit.xs. Oddness. -- /||** Founder and CTO ** ** http://axkit.com/ ** //||** AxKit.com Ltd ** ** XML Application Serving ** // ||** http://axkit.org ** ** XSLT, XPathScript, XSP ** // \\| // ** mod_perl news and resources: http://take23.org ** \\// //\\ // \\
Re: perl-based authentication
On Thu, May 10, 2001 at 11:50:31PM -0600, Mark Holt wrote: > parsing the .htaccess files is what I'm trying to avoid. I want the standard apache > module to do that. I just want to control *when*. have you considered breaking up the apache instances, maybe? might be a bad idea, but i thot i'd suggest it... if paid-vs-free hosts are reasnably well-known at server startup, and there's not lots of changeover from one group to another, maybe you can break the server up into two instances? one for paid (looking at the .htaccess files) and another for freebies (ignore .htaccess files)... -- my other .signature is really witty. [EMAIL PROTECTED] http://sourceforge.net/projects/newbiedoc -- we need your brain! http://www.dontUthink.com/ -- your brain needs us!
Re: Re: Re: installating mod_perl-1.25/apache_1.3.19/perl 5.005_02/solaris 5.6
Hi there, On 11 May 2001, qazi Ahmed wrote: > I am implementing NIS Authentication in a project. > Using Apache1.3.19, modperl_1.25,perl 5.005_02 and libwww-perl package plus > some more packages needed in my project. [snip] > In httpd.conf when i try to put > > PerlRequire /eg/startup.pl [snip] > Syntax error on line 547 of >/export/home/ats/test-tools/ats/guts/apache/conf/httpd.conf: > Invalid command 'PerlRequire', perhaps mis-spelled or defined by a module not >included in the server configuration You haven't got a mod_perl server. Look in the Guide. http://perl.apache.org/guide 73, Ged. PS: It's considered very bad form to write for help privately, because the people who can help very quickly are overloaded by questions from so many people. Please address your questions to the mod_perl List.
Re: Regarding the PerlAuthenHandler[2]
You should see this one. Compiled-in modules: -- snip -- mod_perl.c see http://perl.apache.org/guide/install.html for how to build mod_perl against apache Jeff On Fri, May 11, 2001 at 04:50:21PM -, qazi Ahmed wrote: > Hi.. > When i am giving the command: > ./httpd -l in the bin directory of apache > i get the following details: > > rad-sun-2> ./httpd -l > Compiled-in modules: > http_core.c > mod_env.c > mod_log_config.c > mod_mime.c > mod_negotiation.c > mod_status.c > mod_include.c > mod_autoindex.c > mod_dir.c > mod_cgi.c > mod_asis.c > mod_imap.c > mod_actions.c > mod_userdir.c > mod_alias.c > mod_access.c > mod_auth.c > mod_setenvif.c > suexec: disabled; invalid wrapper >/export/home/ats/test-tools/ats/guts/apache/bin/suexec > rad-sun-2> > > > > What should i get actually to confirm that mod_perl is installed properly. > And further if suexec is an error, please reply by sending the solution to overcome >it. > Thanks and regards > Qazi > > > - Original Message -- > Owen Boyle <[EMAIL PROTECTED]> wrote: > To:qazi Ahmed <[EMAIL PROTECTED]> > From:Owen Boyle <[EMAIL PROTECTED]> > Date:Fri, 11 May 2001 14:01:11 +0200 > Subject: Re: Regarding the PerlAuthenHandler > > qazi Ahmed wrote: > > > > Syntax error on line 547 of >/export/home/ats/test-tools/ats/guts/apache/conf/httpd.conf: > > Invalid command 'PerlRequire', perhaps mis-spelled or defined by a module not >included in the server configuration > > Are you *really* sure you have installed mod_perl? Try ./httpd -l to > list the modules and check.. > > Rgds, > > Owen Boyle. > > _ > Chat with your friends as soon as they come online. Get Rediff Bol at > http://bol.rediff.com > > > Thanks, Jeff -- | Heres milk in your eye.. | | and on your shirt, shorts, couch, and floor. | |- Matthew Scott Sheffield | | (@ six months old)| -- | Jeff Sheffield | | [EMAIL PROTECTED] | | AIM=JeffShef ICQ=4340529 Yahoo=jsheffieus | | NowDocs http://www.nowdocs.com (day gig) | --
Re: perl-based authentication
Mark, I am by no means a mod_perl guru... and this may not solve your full problem... but, you could put something httpd.conf that says something like: if ($paid) then allow .htaccess files; else don't. In other words, AllowOverride AuthConfig if paid; else AllowOverride None. Something along those lines would solve for part of your problem atleast. Then it would just be up to the users to invoke the authentication. I hope this could help you some. Later. Carey Burgess _ Get your FREE download of MSN Explorer at http://explorer.msn.com
Regarding the PerlAuthenHandler[2]
Hi.. When i am giving the command: ./httpd -l in the bin directory of apache i get the following details: rad-sun-2> ./httpd -l Compiled-in modules: http_core.c mod_env.c mod_log_config.c mod_mime.c mod_negotiation.c mod_status.c mod_include.c mod_autoindex.c mod_dir.c mod_cgi.c mod_asis.c mod_imap.c mod_actions.c mod_userdir.c mod_alias.c mod_access.c mod_auth.c mod_setenvif.c suexec: disabled; invalid wrapper /export/home/ats/test-tools/ats/guts/apache/bin/suexec rad-sun-2> What should i get actually to confirm that mod_perl is installed properly. And further if suexec is an error, please reply by sending the solution to overcome it. Thanks and regards Qazi - Original Message -- Owen Boyle <[EMAIL PROTECTED]> wrote: To:qazi Ahmed <[EMAIL PROTECTED]> From:Owen Boyle <[EMAIL PROTECTED]> Date:Fri, 11 May 2001 14:01:11 +0200 Subject: Re: Regarding the PerlAuthenHandler qazi Ahmed wrote: > > Syntax error on line 547 of >/export/home/ats/test-tools/ats/guts/apache/conf/httpd.conf: > Invalid command 'PerlRequire', perhaps mis-spelled or defined by a module not >included in the server configuration Are you *really* sure you have installed mod_perl? Try ./httpd -l to list the modules and check.. Rgds, Owen Boyle. _ Chat with your friends as soon as they come online. Get Rediff Bol at http://bol.rediff.com
Re: Object - RDBMS mapping tools and mod_perl
On Fri, 11 May 2001, Chris Winters wrote: > > Anyone (including Chris) done a comparison of the two (SPOPS and > > Tangram) and willing to comment on strengths, weaknesses, > > differences, etc? > > That is an excellent idea and would be quite useful. I'll see what I > can do in the (relatively) near future. I started working on such a thing (comparing various persistence solutions for Perl) a long time ago. You can see where I was at if you look at: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/poop/documents/poop-comparison.pod?rev=1.2&content-type=text/vnd.viewcvs-markup If you want to help it'd be much appreciated. The goal is to finish it, turn it into HTML and stick it somewhere that people will see it (poop.perl.org?) -dave /*== www.urth.org We await the New Sun ==*/
Pnotes not working
I am having trouble getting pnotes to work and wonder if there is something obvious I am missing. in PerlAuthenHandler I have gone back to the Apache man page and tried to recreate the example given there but to no avail. Below is the code: package My::User; sub handler{ my $r = new Apache::Request(shift); $r->log_error("Are we actually here?"); $r->pnotes("MY_HANDLER" => [qw(one two three)]); } # seperate file package My::Main; sub handler{ my $r = new Apache::Request(shift); my $var = $r->pnotes("MY_HANDLER"); $r->log_error("This is var $var->[0]"); } in httpd.conf SetHandler perl-script AuthType test AuthName test PerlAuthenHandler My::User require valid-user PerlHandler My::Main when I check the error log it is hitting the My::User::handler but nothing is returned to $var in My::Main. if i just check $r->pnotes() it returns an empty hash ref. On another note i originally had My::User::handler named My::User::authenticate but when called from httpd.conf I got an error "Could not locate object method authenticate via package My::User." even though I did preload both My::Main and My::User in startup.pl and also added a PerlModule My::User to httpd.conf just to be sure. perhaps the two are related but I cannopt figure out either for the life of me. any help would be greatly appreciated. OS RH7.0 apache 1.3.14 mod_perl 1.24_01 php/4.03 mod_ssl/2.71 openSSL/0.9.6
Re: Object - RDBMS mapping tools and mod_perl
* Ray Zimmerman ([EMAIL PROTECTED]) [010511 08:01]: > Using Dave Rolsky's OO-RDBMS vs RDBMS-OO sort of description of > Tangram and Alzabo, it sounds like SPOPS is more in the same category > as Tangram, correct? That's correct. I think Tangram is more of a 'pure' object storage solution than SPOPS is, and, IIRC, Tangram also requires you to modify your table schema to use it. > Anyone (including Chris) done a comparison of the two (SPOPS and > Tangram) and willing to comment on strengths, weaknesses, > differences, etc? That is an excellent idea and would be quite useful. I'll see what I can do in the (relatively) near future. Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
NTML authentication
Is there a module that I can use to authenticate an LWP request to a site that uses NTLM authentication? I haven't found an LWP::Authen::NTLM ... /Jonas
Re: Regarding the PerlAuthenHandler
qazi Ahmed wrote: > > Syntax error on line 547 of >/export/home/ats/test-tools/ats/guts/apache/conf/httpd.conf: > Invalid command 'PerlRequire', perhaps mis-spelled or defined by a module not >included in the server configuration Are you *really* sure you have installed mod_perl? Try ./httpd -l to list the modules and check.. Rgds, Owen Boyle.
Re: Cutting down on the DEBUG bloat...
On Thu, May 10, 2001 at 03:28:16PM -0700, Doug MacEachern wrote: > > http://perl.apache.org/~dougm/condsub-0.01.tar.gz > > see test.pl for the examples. > i'm open to names/interface changes I've had good luck (on non performance critical code) doing something like (from memory): use Regexp::Shellish "compile_shellish" ; my $debug_pat = join "|", map compile_shellish( $_ ), @$opt_debug ; sub debugging { caller =~ /$debug_pat/ } ...code passes... debug "Egad! say it ain't so!" if debugging ; (debug() emulates Data::Dumper--which is too limited w.r.t. Regexps and CODE refs in some perls--to dump refs, prints "" for undefined vals, etc.). This has let me selectively enable debugging at the command line by defining -d to take strings like: foo -d Foo::Bar foo -d Foo::* foo -d Foo::* -d Bar::* foo -d ## Same as -d "*" which lets me debug a class, package, group of same, or the entire app. Since __PACKAGE__ is known at compile time, perhaps something like this be "front-ended" to your optimization without noticable performance penalty. It's really nice (IMESHO) to be able to focus debugging on a subsystem like this on larger apps, or apps with a pluggable architecture. The main pain is for OO code where Blah inherits from Foo, you can't cheaply write debugging() so that it's sensitive to inheritence. Since the app is not performance sensitive (it forks around a *lot*) I actually did something like: sub debugging { grep /$debug_pat/, ((caller 0)[3] || "main::"), @_ ; } which allowed me to do things like debug "Um, doing something" if debugging ; debug "Um, doing something" if debugging $self ; debug "Um, doing something" if debugging "output" ; in methods. I ended up caching a few things and instrumenting it a little so I could issue warnings in an END sub if any of the -d args weren't checked against actual code, meaning that you probably mispelled a -d value. I've been meaning to clean that up and put it in a module for some time. I'll get it out sooner now :-). Anyway, just an API that I've found useful. - Barrie
Re: Object - RDBMS mapping tools and mod_perl
At 12:03 AM -0400 5/11/01, Chris Winters wrote: >SPOPS is built to map objects to relational databases, or other data >stores. If you're just getting/setting object properties and >persistence (create/update/fetch/remove) along with relationships >among the objects, you don't even need to write any Perl code. Just >some fairly simple configuration info. Plus you can (if you wish) get >per-object security for free. Using Dave Rolsky's OO-RDBMS vs RDBMS-OO sort of description of Tangram and Alzabo, it sounds like SPOPS is more in the same category as Tangram, correct? Anyone (including Chris) done a comparison of the two (SPOPS and Tangram) and willing to comment on strengths, weaknesses, differences, etc? Thanks, Ray
Regarding the PerlAuthenHandler
Hi Guru's I am implementing NIS Authentication in my project. Using Apache1.3.19, modperl_1.25,perl 5.005_02. In httpd.conf when i try to put PerlRequire /eg/startup.pl PerlModule Apache::AuthenNIS AuthType Basic AuthName "NIS Authentication" PerlAuthenHandler Apache::AuthenNIS i get the error Syntax error on line 547 of /export/home/ats/test-tools/ats/guts/apache/conf/httpd.conf: Invalid command 'PerlRequire', perhaps mis-spelled or defined by a module not included in the server configuration ./apachectl start: httpd could not be started In startup.pl i have mentioned the path of my perl modules(AuthenNIS.pm etc) using use lib qw(../../../); Please hint some expertise suggestions.. Thanks and regards Qazi Firdous _ Chat with your friends as soon as they come online. Get Rediff Bol at http://bol.rediff.com