Re: [ANNOUNCE] HTTP::GHTTP
On Tue, 21 Nov 2000, Matt Sergeant wrote: > This is a bit off topic as its not specifically mod_perl, but I wrote it > for use in a mod_perl environment, so I figure it will be useful to other > people. > > HTTP::GHTTP is a lightweight HTTP client library based on the gnome > libghttp library. It offers a pretty simple to use API for doing HTTP > requests. This can be useful under mod_perl because the alternatives > (e.g. LWP) are quite large. > > Example usage: > > # short get() method > use HTTP::GHTTP 'get'; > print get("http://axkit.org/"); > > # longer OO usage > my $r = HTTP::GHTTP->new(); > $r->set_uri("http://xml.com"); > $r->process_request; > print $r->get_body; > > Supports proxies and authentication too. Heading to CPAN now. Excellent! =) Pavel -- Bask in the glow of the digital silence http://www.vancouver.yi.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Patch for Connection Pooling with DBI::ProxyServer
Hi Jochen, > > to be honest, I don't understand the details of your patch. > I understand that you fork off some child processes and > and use connect_cached. But how do the different processes > interact? How do you guarantee, that the data from one > client reaches the right server process? > There is nothing more to understand, that's all what I do. There is no interaction between the childs of the server process. The client connects to one server child, does all it's database i/o and then disconnects (when it disconnects from the db handle). So all database interaction from one client occurs with one server child process and there is no need to exchange data between the childs. Of course, the next time the same client connects to the server, it normaly doesn't get the same server child, but this doesn't matter very much. You end up with that every server childs process has an open connection to the database and if a client comes to a server process which already has opened the connection to the requested database, the server childs process doesn't need to connect anymore. It's similiar as with Apache and using Apache::DBI under mod_perl. By defining the number of childs you limit the maximum number of database connections you will open. I use it in an environment where normaly Apache::DBI keeps my database connections open, but there some seldom used connections and I don't like to end up with to many open connections. On the other side I don't like to connect for every request (because Orcale connects are slow), so DBI::ProxyServer holds the connection open for me and limits the number of open connections (and therefore the need for licences and resources). Is this more clear now? Gerald P.S. Of course it would be much better to do the same with threads, but from what I know so far not all DBD drivers are thread safe and it would me require to install a second threaded Perl. Does anybody know which DBD drivers are thread safe, not by simply serializing all calls via a mutex, but in a way that let them allow multiple requests at the same time within different threads, but in the same process? - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] $r->header_out(Location=>"$dst") browser response
Follow up: Well I screwed up, but at least now I know it! The 303 status code did give me the result I wanted, but after I removed the bug which caused the problem, I no longer need to use it. (I had a global variable which was previously set and latter caused my REDIRECT to cycle right back to the previous REDIRECT location. Kind of like a, "REDIRECT pong bug". :-). Sorry to have bothered you about this one, but I did learn something about the http status codes and such. >| Is there a way to tell the browser(s) not to make this same substitution >in >| the near future? >| Or, is there a better way to do a one time only redirect from within a >| dynamic page? > >I don't expect IE to do anything by the rules, but maybe you can experiment >with sending an explicit Status: 303, as described on >http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4 > Yes, the 303 status code is exactly what I needed. I also tried setting the "Expire" time to a negative and a small positive time in conjunction with the "normal" REDIRECT (302) status return code, but IE 5 still did not hack the response favorably. I hope that SEE_OTHER {302} can be added to mod_perl's: FakeRequest.pm for future reference. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re:coredump on Carps in startup.pl
Hey thanks a lot. I'm just going blind or something, because when I see a URL and click... If it quacks, it's a duck :-). But seriously, I have had the problem that this patch is suppose to fix. I do appreciate your efforts. I'll let you know how it turns out. Thanks. At 04:34 AM 11/21/00 +, you wrote: >OK, now I'm using a mailer that doesn't insert newlines, so you should find this hyperlink clickable. I've cc'd myself so I'll check that it works. Here it is: > >http://forum.swarthmore.edu/epigone/modperl/sningvezerd/26091135.MAA145 [EMAIL PROTECTED] > >-- > Jeremy Howard > [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New Module Idea: MLDBM::Sync
On Tue, 21 Nov 2000, Joshua Chamas wrote: > On my box, some rough numbers in writes per sec, with doing a > tie/untie for each write, are: > > sync writes/sec with tie/untie > > SDBM_File 1000 > DB_File 30 > GDBM_File 40 > > Note that on a RAM disk in Linux, DB_File goes to 500 writes per sec, > but setting up a RAM disk is a pain, so I'd probably use File::Cache > which gets about 300 writes per sec on the file system. Useful numbers. It looks as if File::Cache is the best approach if you need anything beyond the SDBM size limit. Maybe some fine-tuning of that module could bring it more in line with SDBM performance. If you have the RAM to spare - and I guess you do, if you're considering things like RAM disks - you could try IPC::MM too. I think it will be faster than the other IPC modules because it's a Perl API to a shared hash written in C. - Perrin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New Module Idea: MLDBM::Sync
Perrin Harkins wrote: > > On Fri, 17 Nov 2000, Joshua Chamas wrote: > > I'm working on a new module to be used for mod_perl style > > caching. I'm calling it MLDBM::Sync because its a subclass > > of MLDBM that makes sure concurrent access is serialized with > > flock() and i/o flushing between reads and writes. > > I looked through the code and couldn't see how you are doing i/o > flushing. This is more of an issue with Berkeley DB than SDBM I think, > since Berkeley DB will cache things in memory. Can you point to me it? > > Also, I'm confused on the usage. Do you open the dbm file and keep it > open, or do you tie/untie on every request? > Yes, tie/untie every request as this consistently flushes i/o in an atomic way for SDBM_File, DB_File, GDBM_File... Without this data can be lost, even for SDBM_File, if multiple processes have tied to these DBMs and are writing concurrently. SDBM_File doesn't get corrupt though like DB_File, so access to it would seem error free without this sync method. On my box, some rough numbers in writes per sec, with doing a tie/untie for each write, are: sync writes/sec with tie/untie SDBM_File 1000 DB_File 30 GDBM_File 40 Note that on a RAM disk in Linux, DB_File goes to 500 writes per sec, but setting up a RAM disk is a pain, so I'd probably use File::Cache which gets about 300 writes per sec on the file system. > You might want to look at the Mason caching API. It would be nice to make > an interface like that available on top of a module like this. > Because of the 1024 byte SDBM_File limit, Mason would probably be better off using File::Cache for caching, but for little bits of data SDBM_File with MLDBM::Sync works really well. Thanks for the feedback. BTW, if you want to experiment with it, the module code I posted will only provide SDBM_File access. I have a fixed version which will work for any DBM format that MLDBM works with, so let me know and I'll send you my latest. --Joshua - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANNOUNCE] HTTP::GHTTP
On Tue, 21 Nov 2000, Perrin Harkins wrote: > On Tue, 21 Nov 2000, Matt Sergeant wrote: > > HTTP::GHTTP is a lightweight HTTP client library based on the gnome > > libghttp library. It offers a pretty simple to use API for doing HTTP > > requests. This can be useful under mod_perl because the alternatives > > (e.g. LWP) are quite large. > > Any idea how it compares to HTTP::Lite in size and speed? Can it do SSL? See my other mail regarding speed. I don't think it can do SSL, but its dependant on libghttp, so when it can do SSL (which I would expect it should be able to at some point in the near future given the patent expiration on RSA), so will HTTP::GHTTP. -- /||** Director and CTO ** //||** AxKit.com Ltd ** ** XML Application Serving ** // ||** http://axkit.org ** ** XSLT, XPathScript, XSP ** // \\| // ** Personal Web Site: http://sergeant.org/ ** \\// //\\ // \\ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANNOUNCE] HTTP::GHTTP
On Tue, 21 Nov 2000, Matt Sergeant wrote: > This is a bit off topic as its not specifically mod_perl, but I wrote it > for use in a mod_perl environment, so I figure it will be useful to other > people. > > HTTP::GHTTP is a lightweight HTTP client library based on the gnome > libghttp library. It offers a pretty simple to use API for doing HTTP > requests. This can be useful under mod_perl because the alternatives > (e.g. LWP) are quite large. I should clarify this... LWP::UserAgent loads about 110K of Perl code (*). And Perl code compiles to more memory than the pure text form of Perl (I haven't tested exactly how much memory it uses though). HTTP::Lite loads about 71K of Perl code (which surprised me!). HTTP::GHTTP loads about 24K of Perl code (note that GHTTP.pm is only 746 bytes of actual Perl, so most of that 24K is the same 24K as loaded by the other 2 modules, Exporter, AutoLoader, Dynaloader, strict, etc, so these will be loaded into your mod_perl anyway). HTTP/GHTTP.so is about 14K stripped on my Linux box. So even unshared its not going to have a big impact on your servers. And GHTTP does all its work in C - the only thing in Perl is the constructor. (*) using: perl -M -e 'print join("\n", values %INC)' | xargs cat | /tmp/nopod | wc (where nopod strips out all pod) Now as for performance. Its a killer: Benchmark: timing 1000 iterations of ghttp, lite... ghttp: 7 wallclock secs ( 0.79 usr + 0.79 sys = 1.58 CPU) lite: 21 wallclock secs ( 6.86 usr + 2.83 sys = 9.69 CPU) (I had to fix a bug in the code, so I'll put a new one on CPAN tomorrow - its always fun how often running benchmarks reveal bugs!) Let me know if you want the benchmark source code. -- /||** Director and CTO ** //||** AxKit.com Ltd ** ** XML Application Serving ** // ||** http://axkit.org ** ** XSLT, XPathScript, XSP ** // \\| // ** Personal Web Site: http://sergeant.org/ ** \\// //\\ // \\ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANNOUNCE] HTTP::GHTTP
On Tue, 21 Nov 2000, Matt Sergeant wrote: > HTTP::GHTTP is a lightweight HTTP client library based on the gnome > libghttp library. It offers a pretty simple to use API for doing HTTP > requests. This can be useful under mod_perl because the alternatives > (e.g. LWP) are quite large. Any idea how it compares to HTTP::Lite in size and speed? Can it do SSL? - Perrin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
implementing server affinity
Most of our pages are served by identical load-balanced boxes, and it doesn't matter which box serves what. However, a few special pages store a lot of per-user session data. Instead of burdening our db machine to store this data, I would like to use the filesystem. This requires that for these special pages, users are assigned a (random) box and are redirected back to that box on subsequent requests (presumably using a cookie). I know that some of load-balancers support this feature, but it seems like it would be relatively simple and efficient to implement by adding a TransHandler to the front-end proxy server on each box. The proxy would connect to a backend mod_perl httpd on a different box if it needed to, for these special pages only. Of course, the front-end proxy servers don't have mod_perl, so the TransHandler would have to be written in C (?). Does anyone know of any existing code that does this sort of thing? Or simply well-written C TransHandlers that I could work off of? Is there a better way? Thanks, Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANNOUNCE] HTTP::GHTTP
This is a bit off topic as its not specifically mod_perl, but I wrote it for use in a mod_perl environment, so I figure it will be useful to other people. HTTP::GHTTP is a lightweight HTTP client library based on the gnome libghttp library. It offers a pretty simple to use API for doing HTTP requests. This can be useful under mod_perl because the alternatives (e.g. LWP) are quite large. Example usage: # short get() method use HTTP::GHTTP 'get'; print get("http://axkit.org/"); # longer OO usage my $r = HTTP::GHTTP->new(); $r->set_uri("http://xml.com"); $r->process_request; print $r->get_body; Supports proxies and authentication too. Heading to CPAN now. -- /||** Director and CTO ** //||** AxKit.com Ltd ** ** XML Application Serving ** // ||** http://axkit.org ** ** XSLT, XPathScript, XSP ** // \\| // ** Personal Web Site: http://sergeant.org/ ** \\// //\\ // \\ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New Module Idea: MLDBM::Sync
On Fri, 17 Nov 2000, Joshua Chamas wrote: > I'm working on a new module to be used for mod_perl style > caching. I'm calling it MLDBM::Sync because its a subclass > of MLDBM that makes sure concurrent access is serialized with > flock() and i/o flushing between reads and writes. I looked through the code and couldn't see how you are doing i/o flushing. This is more of an issue with Berkeley DB than SDBM I think, since Berkeley DB will cache things in memory. Can you point to me it? Also, I'm confused on the usage. Do you open the dbm file and keep it open, or do you tie/untie on every request? > Any thoughts? You might want to look at the Mason caching API. It would be nice to make an interface like that available on top of a module like this. - Perrin > package MLDBM::Sync; > use MLDBM; > use Fcntl qw(:flock); > use strict; > no strict qw(refs); > use vars qw($AUTOLOAD); > > sub TIEHASH { > my($class, $file, @args) = @_; > > my $fh = "$file.lock"; > open($fh, ">>$fh") || die("can't open file $fh: $!"); > > bless { > 'args' => [ $file, @args ], > 'lock' => $fh, > 'keys' => [], > }; > } > > sub DESTROY { > my $self = shift; > if (($self->{lock})) { > close($self->{lock}) > } > } > > sub AUTOLOAD { > my $self = shift; > $AUTOLOAD =~ /::([^:]+)$/; > my $func = $1; > $self->exlock; > my $rv = $self->{dbm}->$func(@_); > $self->unlock; > $rv; > } > > sub STORE { > my $self = shift; > $self->exlock; > my $rv = $self->{dbm}->STORE(@_); > $self->unlock; > $rv; > }; > > sub FETCH { > my $self = shift; > $self->shlock; > my $rv = $self->{dbm}->FETCH(@_); > $self->unlock; > $rv; > }; > > sub FIRSTKEY { > my $self = shift; > $self->shlock; > $self->{keys} = [ keys %{$self->{dbm_hash}} ]; > $self->unlock; > $self->NEXTKEY; > } > > sub NEXTKEY { > shift(@{shift->{keys}}); > } > > sub mldbm_tie { > my $self = shift; > my $args = $self->{args}; > my %dbm_hash; > my $dbm = tie(%dbm_hash, 'MLDBM', @$args) || die("can't tie to MLDBM with args: >".join(',', @$args)."; error: $!"); > $self->{dbm_hash} = \%dbm_hash; > $self->{dbm} = $dbm; > } > > sub exlock { > my $self = shift; > flock($self->{lock}, LOCK_EX) || die("can't write lock $self->{lock}: $!"); > $self->mldbm_tie; > } > > sub shlock { > my $self = shift; > flock($self->{lock}, LOCK_SH) || die("can't share lock $self->{lock}: $!"); > $self->mldbm_tie; > } > > sub unlock { > my $self = shift; > undef $self->{dbm}; > untie %{$self->{dbm_hash}}; > flock($self->{lock}, LOCK_UN) || die("can't unlock $self->{lock}: $!"); > } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: open source projects on mod_perl
On Tue, 21 Nov 2000 [EMAIL PROTECTED] wrote: > On Tue, 21 Nov 2000, Ilya Soldatkin wrote: > > > Are there any open source projects running under mod_perl? > > I am interested in OOP projects working with SQL databases with good style of >programming. > > I'd like to use them to make my code better. If you know such projects, could you >give me links to them. > > I will be also grateful if somebody emal me such examples of good code. > > > > Class::DBI > Tangram > ... And Alzabo (alzabo.sourceforge.net). It has some pieces specifically designed for mod_perl (Alzabo::ObjectCacheIPC class). -dave /*== www.urth.org We await the New Sun ==*/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Patch for Connection Pooling with DBI::ProxyServer
Hi, Gerald, to be honest, I don't understand the details of your patch. I understand that you fork off some child processes and and use connect_cached. But how do the different processes interact? How do you guarantee, that the data from one client reaches the right server process? I can only imagine, that there is still only one process serving all clients. This is probably due to an insufficient understanding of sharing file handles. Sorry, Jochen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_perl for NT when using another Web server other than Apache.
Matthew Byng-Maddick <[EMAIL PROTECTED]> writes: > On Tue, 21 Nov 2000, Gurumustuk Singh Khalsa wrote: > > Hi there... I was just wondering if any of you know of a way to use > > mod_perl on NT using another webserver other than Apache. I am running > > the Lotus Domino web server and currently have the latest ActivePerl > > installed. > > No. Mod_perl is heavily tied into the Apache API. I don't know whether > Domino supports ISAPI, but someone I know was looking into the prospect of > writing a mod_perl for ISAPI. Perhaps you should be looking more in that > direction? How about putting a proxy on the front and running a mod_perled Apache? How hairy could that get? Depends how "integrated" the perl has to be with the Domino guts I guess... -- 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 - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_perl for NT when using another Web server other than Apache.
On Tue, 21 Nov 2000, Gurumustuk Singh Khalsa wrote: > Hi there... I was just wondering if any of you know of a way to use > mod_perl on NT using another webserver other than Apache. I am running > the Lotus Domino web server and currently have the latest ActivePerl > installed. No. Mod_perl is heavily tied into the Apache API. I don't know whether Domino supports ISAPI, but someone I know was looking into the prospect of writing a mod_perl for ISAPI. Perhaps you should be looking more in that direction? > Any help would be greatly appreciated! Not much that anyone can do, unfortunately. MBM -- Matthew Byng-Maddick Home: <[EMAIL PROTECTED]> +44 20 8981 8633 (Home) http://colondot.net/ Work: <[EMAIL PROTECTED]> +44 7956 613942 (Mobile) Trifles make perfection, and perfection is no trifle. -- Michelangelo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Auth question for an Apache module (Not an Auth Module!!:):)
I have written an Apache module for our own internal use, that basically runs under one sub-dir of the doc root, i.e. http://som.server.com/dir. There are only about 4 or 5 valid URLs inside that URI, so I only check for one of those in the request, and return DECLINED if it is not one of those. Now, one of those URLs needs to be password protected. Basic auth is fine. But, can I configure that in the .conf, or will I have to code it in my module?? David McCabe Unix System Administrator Le Groupe Videotron [EMAIL PROTECTED] (514) 380 4433 Our bombs are smarter than the average high school student. At least they can find Kuwait. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_perl for NT when using another Web server other than Apache.
Hi there... I was just wondering if any of you know of a way to use mod_perl on NT using another webserver other than Apache. I am running the Lotus Domino web server and currently have the latest ActivePerl installed. Any help would be greatly appreciated! Sincerely, Gurumustuk Singh Khalsa e-mail [EMAIL PROTECTED] Sikhnet - http://www.Sikhnet.com SikhSeek - http://www.SikhSeek.com Matrimonials - http://www.SikhMatrimonials.com Free E-mail- http://www.Sikhnet.com/email _ SikhNet - http://www.SikhNet.com Matrimonials - http://SikhMatrimonials.com Free e-mail: http://www.SikhNet.com/email I-Sikh: http://sikhnet.com/s/ISikhMessenger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache::ASP (QueryString eats +)
On 21 Nov, sergen wrote: > > When sending text with "+" by "?" on url $Request->QueryString > eats > "+" (the text is absolutely the same but only this sign). >Is it a bug or may be some else ? > >using: Mandrake 7.2 > Apache 1.3.14-2mdk >apache-mod_perl 1.3.14_1.24-2mdk >Apache-ASP 2.002mdk >httpd-perl (proxied) > >If someone know what to do pls send a sign, thnks Note that URL encoding treats the symbol '+' as the URL encoded version of the symbol ' ' (space, ASCII 32). The sequence of characters you need to include in a query string in order to have your script interpret it as the symbol '+' is '%43'. Your problem report isn't exactly clear on what you mean by "eats", but this may be your trouble. HTH Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Installing the DBD module for Microsoft SQLServer!!!
Hi all, Now, I have another problem. When I runned the "perl Makefile.PL" and "make" commands they work very well. But, when I runned "make test" is returned the following message: "Writing "Makefile.aperl" for this perl Using DBI 1.14 installed in /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBI Writing Makefile.aperl for DBD::FreeTDS make -f Makefile.aperl perl make[1]: Entering directory `/root/freetds_dbd/freetds_dbd' Writing perlmain.c cd . && gcc -c -I/usr/lib/perl5/5.00503/i386-linux/CORE -Dbool=char -DHAS_BOOL -I/usr/local/include -Wall -Wmissing-prototypes -ggdb -static -DTRACE_ALLOCMEMORY_LEAKS -ggdb \ -DVERSION=\"0.03a\" \ -DXS_VERSION=\"0.03a\" -I/usr/lib/perl5/5.00503/i386-linux/CORE perlmain.c cat /usr/lib/perl5/5.00503/i386-linux/auto/DynaLoader/extralibs.ld >> blib/arch/auto/DBD/FreeTDS/extralibs.all cat blib/arch/auto/DBD/FreeTDS/extralibs.ld >> blib/arch/auto/DBD/FreeTDS/extralibs.all gcc -L/usr/local/lib -rdynamic -o perl -ggdb ./perlmain.o blib/arch/auto/DBD/FreeTDS/FreeTDS.a /usr/lib/perl5/5.00503/i386-linux/auto/DynaLoader/DynaLoader.a /usr/lib/perl5/5.00503/i386-linux/CORE/libperl.a `cat blib/arch/auto/DBD/FreeTDS/extralibs.all` -lnsl -ldl -lm -lc -lposix -lcrypt To install the new "perl" binary, call make -f Makefile.aperl inst_perl MAP_TARGET=perl To remove the intermediate files say make -f Makefile.aperl map_clean make[1]: Leaving directory `/root/freetds_dbd/freetds_dbd' PERL_DL_NONLAZY=1 ./perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.00503/i386-linux -I/usr/lib/perl5/5.00503 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/01loadok t/02connect.database is jdbctest server is testms port name is 1433 port num is 1433 uid is testuser password is password DBI->connect(database=jdbctest;host=testms;port=1433;) failed: Couldn't find host testms at t/./TestCommon.pm line 17 Can't call method "disconnect" on an undefined value at t/02connect.t line 26. tdslayer.c:2952: Didn't free block at 0x823f47c dbdimp.c:387: Didn't free block at 0x8230cec dbdimp.c:378: Didn't free block at 0x8235d5c dubious Test returned status 255 (wstat 65280, 0xff00) Undefined subroutine &Test::Harness::WCOREDUMP called at /usr/lib/perl5/5.00503/Test/Harness.pm line 288. make: *** [test_static] Error 255" Same with it error in the "make test" command, when I runned "make install" the System don't return any error message ( it's OK ). Now, when I try to run one perl script, it doesn't work and the following message is showed: "install_driver(FreeTDS) failed: Can't locate loadable object for module DBD::FreeTDS in @INC (@INC contains: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 .) at (eval 1) line 3 Perhaps a module that DBD::FreeTDS requires hasn't been fully installed at Tempo_Resposta_MS_Perl.pl line 28" I don't know what to do to resolve this problem anymore. Can anyone tell me how I can resolve it? Thanks, Edmar Edilton da Silva Bacharel em Ciência da Computacão - UFV Mestrando em Ciência da Computacão - UNICAMP
sendmail processes hanging around after I switch to mod_perl
Hi All I'm running apache 1.3.14 mod_perl 1.23 on red hat linux 6.2 kernel 2.2.17 sendmail 8.9.3-20 After switching to mod_perl from plain cgi scripts I find that sendmail processes are hanging around after http requests are supposed to have served. many of my scripts heavily make use of chunks of perl codes like open S,'|/usr/sbin/sendmail -t -oi' or die $!; .. .. close S or die $!; With plain cgi scripts I ran sendmail in daemon mode; it was configured NOT to listen i.e. it only sends mail NOT receive. After switching to mod_perl many sendmail processes hang around after the requests are supposed to have served. So I decided to kill the daemon. But I'm still getting these processes hanging around. Any idea? I would think that once close S statement is reached perl would release any attachment to sendmail and thus from that point on whether I use mod_perl or plain cgi scripts would not matter. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dealing with spiders
I vote for that! Make my life about 5000 times simpler :) Marko van der Puil wrote: > Hi, > > I had the same thing, sometimes the spiders are programmed VERY sloppy. I had a > site that responed to ANY request made to its location. The mayoraty of spiders > does not understand about single and double qoutes or if you leave quotes out of > your HREF's at all. also I understand that absolute href="/bla" and relative > href="../bla" are also a problem. > > Those spiders would simply start getting urls like GET > /foo/file=1243/date=12-30-2000/name=foobar'/foo/file=1243/date=12-30-2000/name=foobar > > or > GET ../bla' > or > GET ../bla/'../bla'../bla' > aso... > > then that page would generate a page with a load of faulty links that would also > be followed. > alle HREF got built on the basis of the data that were in the requested URL. > > Then other spiders got those faulty links from eachother and soon I got more > traffic from spiders trying to index faulty links than from regular visitors. :) > > What I did was to check the input for a particular url and see if it was correct. > (should have done that in the first place.) Then I 404red the bastards I am > now redirecting them to the main page, which looks nicer on yer logs too. Plus > the spider might be tempted to spider yer page regularly. (most spiders drop > redirects.) You could also just return a plaintext OK. lots of nice 200's in yer > stats... > Another solution I have seen is returning a doorway page to your site. > (Searchengine SPAM!) Thats hittingthem back where it hurts. :) > > I've made remarks about this to the owners of those spiders (excite/altavista) > but I have had no satisfactory responses from them. > > What we could do as a community is create spiderlawenforcement.org, a centralized > database where we keep track of spiders and how they index our sites. We could > build a database of spiders indexed by Agent tag, those following robots.txt and > those explicitly exploiting that, or blacklist some by IP if they keep breaking > the rules. Lots of developers could use this database to block those nasty sons > of er well, sons of spiders I suppose. All opensourced of course, and the > data available for free, some perl modules to approach the db. Send an email to > the administrator of the spider everytime a spider tries a bad link on a member > site, and watch how fast thell fix the bl**dy things! > > Let me know if any of you are interrested in such a thing. > > Bill Moseley wrote: > > > This is slightly OT, but any solution I use will be mod_perl, of course. > > > > I'm wondering how people deal with spiders. I don't mind being spidered as > > long as it's a well behaved spider and follows robots.txt. And at this > > point I'm not concerned with the load spiders put on the server (and I know > > there are modules for dealing with load issues). > > > > But it's amazing how many are just lame in that they take perfectly good > > HREF tags and mess them up in the request. For example, every day I see > > many requests from Novell's BorderManager where they forgot to convert HTML > > entities in HREFs before making the request. > > > > Here's another example: > > > > 64.3.57.99 - "-" [04/Nov/2000:04:36:22 -0800] "GET /../../../ HTTP/1.0" 400 > > 265 "-" "Microsoft Internet Explorer/4.40.426 (Windows 95)" 5740 > > > > In the last day that IP has requested about 10,000 documents. Over half > > were 404 requests where some 404s were non-converted entities from HREFs, > > but most were just for documents that do not and have never existed on this > > site. Almost 1000 request were 400s (Bad Request like the example above). > > And I'd guess that's not really the correct user agent, either > > > > In general, what I'm interested in stopping are the thousands of requests > > for documents that just don't exist on the site. And to simply block the > > lame ones, since they are, well, lame. > > > > Anyway, what do you do with spiders like this, if anything? Is it even an > > issue that you deal with? > > > > Do you use any automated methods to detect spiders, and perhaps block the > > lame ones? I wouldn't want to track every IP, but seems like I could do > > well just looking at IPs that have a high proportion of 404s to 200 and > > 304s and have been requesting over a long period of time, or very frequently. > > > > The reason I'm asking is that I was asked about all the 404s in the web > > usage reports. I know I could post-process the logs before running the web > > reports, but it would be much more fun to use mod_perl to catch and block > > them on the fly. > > > > BTW -- I have blocked spiders on the fly before -- I used to have a decoy > > in robots.txt that, if followed, would add that IP to the blocked list. It > > was interesting to see one spider get caught by that trick because it took > > thousands and thousands of 403 errors before that spider got a clue that it > > was blocked on every request. > > > > T
Re: DBD module for Microsoft SQLServer!!!
Sorry, the error message during the installation process of the DBD module is the following: /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:101: parse error before `Perl_do_close' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:101: parse error before `bool' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:101: warning: type defaults to `int' in declaration of `Perl_do_close' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:101: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:102: parse error before `Perl_do_eof' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:102: warning: type defaults to `int' in declaration of `Perl_do_eof' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:102: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:103: parse error before `Perl_do_exec' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:103: warning: type defaults to `int' in declaration of `Perl_do_exec' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:103: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:115: parse error before `Perl_do_open' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:116: warning: type defaults to `int' in declaration of `Perl_do_open' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:116: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:118: parse error before `Perl_do_print' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:118: warning: type defaults to `int' in declaration of `Perl_do_print' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:118: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:121: parse error before `Perl_do_seek' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:121: warning: type defaults to `int' in declaration of `Perl_do_seek' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:121: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:149: parse error before `bool' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:182: parse error before `Perl_hv_exists' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:182: warning: type defaults to `int' in declaration of `Perl_hv_exists' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:182: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:183: parse error before `Perl_hv_exists_ent' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:183: warning: type defaults to `int' in declaration of `Perl_hv_exists_ent' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:183: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:204: parse error before `Perl_io_close' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:204: warning: type defaults to `int' in declaration of `Perl_io_close' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:204: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:522: parse error before `Perl_sv_2bool' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:522: warning: type defaults to `int' in declaration of `Perl_sv_2bool' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:522: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:554: parse error before `Perl_sv_derived_from' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:554: warning: type defaults to `int' in declaration of `Perl_sv_derived_from' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:554: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:592: parse error before `Perl_sv_tainted' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:592: warning: type defaults to `int' in declaration of `Perl_sv_tainted' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:592: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:596: parse error before `Perl_sv_upgrade' /usr/lib/perl5/5.00503/i386-linux/CORE/proto.h:596: warning: type defaults to `int' in declaration of `Perl_sv_upgrade' /usr/lib/perl5/5.00503/i386-linux/CORE/intrpvar.h:41: parse error before `PL_sawampersand' /usr/lib/perl5/5.00503/i386-linux/CORE/intrpvar.h:41: warning: type defaults to `int' in declaration of `PL_sawampersand' /usr/lib/perl5/5.00503/i386-linux/CORE/intrpvar.h:41: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/intrpvar.h:42: parse error before `PL_sawstudy' /usr/lib/perl5/5.00503/i386-linux/CORE/intrpvar.h:42: warning: type defaults to `int' in declaration of `PL_sawstudy' /usr/lib/perl5/5.00503/i386-linux/CORE/intrpvar.h:42: warning: data definition has no type or storage class /usr/lib/perl5/5.00503/i386-linux/CORE/intrpvar.h:43: parse error before `PL_sawvec' /usr/lib/perl5/5.00503/i386-linux/CORE/intrp
Re: moidperl, OOP & DBI
Hi Ilya. Even though this isn't a mod_perl issue you should be able to open your database connection within your constructor. You also could maybe call an internal method from within your constructor that opens the db connection and checks for the existence of 'id'. - Sean On Tue, 21 Nov 2000, Ilya Soldatkin wrote: > I am creating an object that make queries to database. But how shall I > explain to him what database handler he shall use? > Under mod_perl it is too dangerous to make $dbh global variable. > Well, I can create data field in this object that will store current $dbh, > but it seems too strange too me to have such data field in object: > > $person={ > name=>'Jack', > age=10, > ..., > $dbh=>... > } > > $dbh have no relation to information about Jack. > Is there any better solution? > > There is some piece of code > --- > mainscript.pl > > > my $dsn = "DBI:$config{'driver'}:database=$config{'dbname'};"; > my $dbh = DBI->connect($dsn, $config{'user'}, $config{'pass'}); > > some SQL queries > .. > > $guest=new Person($dbh,$id); > print < Guest name:$guest->name; > Guest age:$guest->age; > END > ; > .. > > -- > Person.pm > > Package Person; > use strict; > > sub new > { > my ($that, $dbh, $id) = @_; > my $class =ref($that)||$that; > my $table ='SITE'; > > my $sth = $dbh->prepare( qq{SELECT * FROM $table where id=?}); > if (!$sth) { die "Error:" . $dbh->errstr . "\n"; } > if (!$sth->execute($id)) { die "Error:" . $sth->errstr . "\n";} > > if (my $ref = $sth->fetchrow_hashref) > { > my $person->{'name'}=$ref->{'name'}; > my $person->{'age'}=$ref->{'age'}; > ... > } > > bless $person, $that; > return $person; > > } > others methods > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing data
ASHISH MUKHERJEE ([EMAIL PROTECTED]) said something to this effect: > Hey all, I am in need of some help. Can anyone pls. tell me how I can pass data from >a Handler to a script ? Can any session data etc. withing a Handler be made >accessible within a script ? Also, how can I pass data between Handlers invoked at >different stages of request processing ? eg. how can I pass some data from an Init >Handler to PerlHandler or from within a script to a Cleanup Handler pnotes is your friend, it lets you pass arbitrary data around (even complex data structures, or objects). PerlModule Foo SetHandler perl-script PerlHandler Foo::content_handler PerlInitHandler Foo::init_handler PerlLogHandler Foo::log_handler package Foo; sub init_handler { my $r= Apache->request; my $data = &_calculate("stuff"); $r->pnotes('data', $data); return OK; } sub content_handler { my $r= Apache->request; my $data = $r->pnotes('data'); $r->print($data); return OK; } sub log_handler { my $r= Apache->request; my $data = $r->pnotes('data'); $r->log->info($data); return OK; } (darren) -- I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me. -- Woody Allen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session expiration
>So basically I want to set a cookie that will allow them to enter the site >under their userid, but I can't allow them to enter if they are currently >logged in from elsewhere. > >Any ideas? I use cookie-based auth in a few places, with a "can be logged in only once" restriction, but I duck the "don't allow them to enter" scenario by letting each new session supercede the old one. I use a database that maps logged-in user IDs to cookies, and once authentication is done (which happens if the user doesn't send a cookie, or doesn't send the right cookie), the new cookie simply overwrites the old one, and the new session becomes the "allowed" one. ...Steve -- Steve van der Burg Information Services London Health Sciences Centre (519) 685-8300 ext 35559 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache::Registry + errors in a browser
Jacek Ostrowski ([EMAIL PROTECTED]) said something to this effect: > hi, > > I have a litle suggestion to Apache::Registry - > I tried to change it to allow script writers > to see compile errors in a browser. > > I'am using mod_perl at my work ( its great - you know ) > but there are few other people working on the same server with me. > All our error messages went to one log file, it was very inconvinient. > I hacked your Apache::Registry to pass all error messages from 'eval's > to browser. Why not just use CGI::Carp? The fatalsToBrowser function will do exactly what you want Registry to do. (darren) -- I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me. -- Woody Allen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DBD module for Microsoft SQLServer!!!
Hi all, I am trying to install the DBD module for Microsoft SQLServer (DBD-FreeTDS-0.02), and I get many error message when the command "make" is executed. I have installed the perl 5.005, mod_perl 1.21, DBI 1.14, and Apache::DBI 0.87. The following commands are used to install the DBD module: perl Makefile.PL make make test make install Can anyone tell me what is wrong in the installation process? Is There another DBD module to access the MS SQLServer Database? Thanks, any help!!! Edmar Edilton da Silva Bacharel em Ciência da Computacão - UFV Mestrando em Ciência da Computacão - UNICAMP
[OT] Re:moidperl, OOP & DBI
Hi Ilya, IS> I am creating an object that make queries to database. But how shall I IS> explain to him what database handler he shall use? IS> Under mod_perl it is too dangerous to make $dbh global variable. IS> Well, I can create data field in this object that will store current $dbh, IS> but it seems too strange too me to have such data field in object: I'd take a look at Damian Conway's book Object Oriented Perl. Has some good examples and pointers on this stuff. (ISBN 1-884777-79-1.) FWIW, I think its okay to have database connectors (or pointers to) within the objects. If you look at an object as being self-sufficient, how else can it connect to the database That's just my opinion, though. This is really not a true mod_perl issue, however. Sorry for veering off-topic. Best Regards, Mike Miller [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: moidperl, OOP & DBI
On Tue, 21 Nov 2000, Ilya Soldatkin wrote: > I am creating an object that make queries to database. But how shall I > explain to him what database handler he shall use? > Under mod_perl it is too dangerous to make $dbh global variable. > Well, I can create data field in this object that will store current $dbh, > but it seems too strange too me to have such data field in object: > > $person={ > name=>'Jack', > age=10, > ..., > $dbh=>... > } > > $dbh have no relation to information about Jack. > Is there any better solution? This really has little to do with mod_perl, more about object design. You should get yourself a book about OO design. Or you can use a Singleton (see Class::Singleton on CPAN, or write your own Singleton module - its only about 10 lines of code). -- /||** Director and CTO ** //||** AxKit.com Ltd ** ** XML Application Serving ** // ||** http://axkit.org ** ** XSLT, XPathScript, XSP ** // \\| // ** Personal Web Site: http://sergeant.org/ ** \\// //\\ // \\ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] mod_perl evangelism
David Hodgkinson <[EMAIL PROTECTED]> writes: > Greg Cope <[EMAIL PROTECTED]> writes: > > > I've always thought that php had better "web support" in terms of "How > > to do this in php" or tutorials. mod_perl's lack of similar > > resources is not a bad thing. > > OK, the London Perlmongers are having a technical session on > Thursday. I'll see who I can beat up there (hi Leo and Leon! ;-)... Right, it's all gone quiet again. I've set up a mailing list to take discussions off this list: http://www.deep-purple.com/mailman/listinfo/brainwash Yes it's mailman. Bite me. -- 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 - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Patch for Connection Pooling with DBI::ProxyServer
Hi, recently there was a large thread on connection pooling. One idea was to use DBI::ProxyServer for this purpose. This may not fit all needs, but some them, at least mine :-) The idea is to use DBI's connect_cached method together with ProxyServer. As in the above mentioned thread already discussed, this doesn't works out of the box. So I hacked my way thru the sources and send two patches which should make this possible. The first one adds the 'connect_cached' configuration directive to dbiproxy's configuration file. If set to true, DBI::ProxyServer uses connect_cached, instead of connect. This alone works pretty well in single mode (of course you have to take care that a process used the database handle before, may have set some attributes. This is similar to the usage of Apache::DBI under mod_perl), but when switching to forked mode it is pretty useless, because every connection gets a new childs and therefore doesn't get any cached connection. So the second patch changes Net::Daemon to pre-fork a fixed number of childs, before doing any processing. You can set the number with the new configuration directive 'childs' (mode is ignored in this case). Because these childs never ends (unless the parent process terminates), we now can set the connect_cached configuration directive from the first patch and get the benefit from cached connections. Any comments are welcome Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 - ProxyServer.pm.diff Daemon.pm.diff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: open source projects on mod_perl
On Tue, 21 Nov 2000, Ilya Soldatkin wrote: > Are there any open source projects running under mod_perl? > I am interested in OOP projects working with SQL databases with good style of >programming. > I'd like to use them to make my code better. If you know such projects, could you >give me links to them. > I will be also grateful if somebody emal me such examples of good code. > Class::DBI Tangram ... Check out the Perl Object Oriented Persitancy group at sourceforge > Thank you > Ilya > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
open source projects on mod_perl
Are there any open source projects running under mod_perl? I am interested in OOP projects working with SQL databases with good style of programming. I'd like to use them to make my code better. If you know such projects, could you give me links to them. I will be also grateful if somebody emal me such examples of good code. Thank you Ilya
Passing data
Hey all, I am in need of some help. Can anyone pls. tell me how I can pass data from a Handler to a script ? Can any session data etc. withing a Handler be made accessible within a script ? Also, how can I pass data between Handlers invoked at different stages of request processing ? eg. how can I pass some data from an Init Handler to PerlHandler or from within a script to a Cleanup Handler Thanks Ashish --- cout<<"Hello World !"; Get FREE Email/Voicemail with 15MB at Lycos Communications at http://comm.lycos.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
moidperl, OOP & DBI
I am creating an object that make queries to database. But how shall I explain to him what database handler he shall use? Under mod_perl it is too dangerous to make $dbh global variable. Well, I can create data field in this object that will store current $dbh, but it seems too strange too me to have such data field in object: $person={ name=>'Jack', age=10, ..., $dbh=>... } $dbh have no relation to information about Jack. Is there any better solution? There is some piece of code --- mainscript.pl my $dsn = "DBI:$config{'driver'}:database=$config{'dbname'};"; my $dbh = DBI->connect($dsn, $config{'user'}, $config{'pass'}); some SQL queries .. $guest=new Person($dbh,$id); printage; END ; .. -- Person.pm Package Person; use strict; sub new { my ($that, $dbh, $id) = @_; my $class =ref($that)||$that; my $table ='SITE'; my $sth = $dbh->prepare( qq{SELECT * FROM $table where id=?}); if (!$sth) { die "Error:" . $dbh->errstr . "\n"; } if (!$sth->execute($id)) { die "Error:" . $sth->errstr . "\n";} if (my $ref = $sth->fetchrow_hashref) { my $person->{'name'}=$ref->{'name'}; my $person->{'age'}=$ref->{'age'}; ... } bless $person, $that; return $person; } others methods - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]