[22453] in Perl-Users-Digest
Perl-Users Digest, Issue: 4674 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 6 14:05:57 2003
Date: Thu, 6 Mar 2003 11:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 6 Mar 2003 Volume: 10 Number: 4674
Today's topics:
Re: "Stupid File Difference" function/module (John Ramsden)
Re: "Stupid File Difference" function/module (John Ramsden)
Re: A problem about the time function (Kevin Cline)
Re: A problem about the time function (Malcolm Ray)
Re: CGI query string help (trwww)
Re: dbm <nobull@mail.com>
Re: Determine type of reference <alex@alexbanks.com>
glob() function - limited number of parameters ? (Romuald Favre)
Help with Inline::CPP.... (Brian Snyder)
Re: How can I write this regex? (Sara)
Re: How can I write this regex? (Sara)
Re: I want to know the line n umber of the error ! <REMOVEsdnCAPS@comcast.net>
Re: I want to know the line n umber of the error ! <REMOVEsdnCAPS@comcast.net>
Re: I want to know the line n umber of the error ! <tore@aursand.no>
Re: Lightweight CGI module? <REMOVEsdnCAPS@comcast.net>
Re: Lightweight CGI module? <REMOVEsdnCAPS@comcast.net>
Re: Lightweight CGI module? <hvtijen@hotwail.com>
Re: Lightweight CGI module? <bkennedy@hmsonline.com>
Re: Lightweight CGI module? <tore@aursand.no>
Re: Lightweight CGI module? <tore@aursand.no>
Re: Lightweight CGI module? <tore@aursand.no>
Re: New module proposed: Class::Accessor::NoviceArray <bkennedy@hmsonline.com>
Re: perl locks up my win98 computer (Nataku)
Re: Perl Vs Python <mpapec@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 6 Mar 2003 09:55:25 -0800
From: john_ramsden@sagitta-ps.com (John Ramsden)
Subject: Re: "Stupid File Difference" function/module
Message-Id: <d27434e.0303060553.54ac0738@posting.google.com>
john_ramsden@sagitta-ps.com (John Ramsden) wrote in message news:<d27434e.0303050753.17c68212@posting.google.com>...
>
> Is there an easy way, that works the same on Unix and Windows,
> of testing whether two files have identical contents?
>
> [...]
Thanks to everyone who replied. I thought there had to be a simple
answer.
(It would have been helpful if 'perldoc -q compare' had given it
though!)
Cheers
John Ramsden (john_ramsden@sagitta-ps.com)
------------------------------
Date: 6 Mar 2003 09:55:26 -0800
From: john_ramsden@sagitta-ps.com (John Ramsden)
Subject: Re: "Stupid File Difference" function/module
Message-Id: <d27434e.0303060554.7d3f326a@posting.google.com>
john_ramsden@sagitta-ps.com (John Ramsden) wrote in message news:<d27434e.0303050753.17c68212@posting.google.com>...
>
> Is there an easy way, that works the same on Unix and Windows,
> of testing whether two files have identical contents?
>
> [...]
Thanks to everyone who replied. I thought there had to be a simple
answer.
(It would have been helpful if 'perldoc -q compare' had given it
though!)
Cheers
John Ramsden (john_ramsden@sagitta-ps.com)
------------------------------
Date: 6 Mar 2003 10:51:31 -0800
From: kcline17@hotmail.com (Kevin Cline)
Subject: Re: A problem about the time function
Message-Id: <ba162549.0303061051.41f05fe8@posting.google.com>
"programmer" <BROWNHIK@Syntegra.Bt.Co.Uk> wrote in message news:<b47mpf$sfi$1@pheidippides.axion.bt.co.uk>...
> > I know there is a fuction "time" give current time when the function is
> > called. But I want to get the seconds since the Epoch for a specific time.
>
>
> I know some of the perl fanatics won't like it because it doesn't use a
> module, but this code has been tested for every second from 1970 to 2037.
> ...
What about the leap-seconds that are added irregularly at the
end of some years?
------------------------------
Date: 6 Mar 2003 19:02:02 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: A problem about the time function
Message-Id: <slrnb6f6pa.m8e.M.Ray@carlova.ulcc.ac.uk>
On Thu, 6 Mar 2003 14:36:01 -0000, programmer <BROWNHIK@Syntegra.Bt.Co.Uk>
wrote:
>
>> I know there is a fuction "time" give current time when the function is
>> called. But I want to get the seconds since the Epoch for a specific time.
>
>
>I know some of the perl fanatics won't like it because it doesn't use a
>module, but this code has been tested for every second from 1970 to 2037.
[snip]
>$leap = (($yyyy % 4) == 0) && ((($yyyy % 100)!=0) || (($yyyy % 400)==0))
Presumably this is a fossil from an earlier version before you realised
the 2038 limitation, because you calculate $leap but never use it.
--
Malcolm Ray University of London Computer Centre
------------------------------
Date: 6 Mar 2003 09:42:52 -0800
From: toddrw69@excite.com (trwww)
Subject: Re: CGI query string help
Message-Id: <d81ecffa.0303060942.21564048@posting.google.com>
"Mothra" <mothra@nowhereatall.com> wrote in message news:<3e662e32@usenet.ugs.com>...
> "William Alexander Segraves" <wsegrave@mindspring.com> wrote in message
> news:b457a4$rmb$1@slb0.atl.mindspring.net...
> > "Blnukem" <blnukem@hotmail.com> wrote in message
> > news:EUn9a.2612$gf7.924287@news4.srv.hcvlny.cv.net...
> [snipped]
> > Your script, corrected:
> >
> > #!/usr/local/bin/perl -w
> > # added -w
> >
> > use strict;
> > use CGI qw(-no_xhtml :standard);
> > # added -no_xhtml prama
> >
> > my $user_name = param('name');
> > my $user_age = param('age');
> ^^^^^
> should'nt that be url_param?
> The params are in the url not the posted form
>
The only time you need to use url_param() is when you are mixing GET
and POST. For instance, if your html form's method is set to POST and
it's action attribute is set to:
http://server/prog.cgi?sessionID=0987654321&expires=1087654321
you have to use the url_param to get the parameters.
But if the above parameters sessionID and expires are in hidden html
input fields and the form's method is set to GET, you can just use the
param() function to get your data.
Todd W.
------------------------------
Date: 06 Mar 2003 18:43:38 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: dbm
Message-Id: <u9heag72ud.fsf@wcl-l.bham.ac.uk>
"joeri" <jvandervloet@hotmail.com> writes:
> I'm trying to build a database using dbmopen.
The first sentence of the documentation for dbmopen() reads "This
function has been largely superseded...".
[ snip trying to store references in an DBM database ]
You can't. You must convert your data to strings. You can just
join() it or use something like Storable.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 6 Mar 2003 16:10:15 -0000
From: "Alex Banks" <alex@alexbanks.com>
Subject: Re: Determine type of reference
Message-Id: <3e6772e9$0$228$cc9e4d1f@news.dial.pipex.com>
perfect! thanks all...
------------------------------
Date: 6 Mar 2003 10:59:00 -0800
From: romuald_favre@hotmail.com (Romuald Favre)
Subject: glob() function - limited number of parameters ?
Message-Id: <34623cba.0303061059.174b9ef8@posting.google.com>
Hello,
In a perl script I use the glob() function in order to list files of a
given directory.
I just made the experience that when there are more than about 300
files in the directory, the function cannot be performed and the perl
program just stop without giving any news...
My deduction is that the glob function accept a limited number of
parameters... Is that right ? If yes, what is the alternative or the
best workaround if i have to read simultaneously thousands of files a
a directory ?
Tanks for you help !
$srcdir = '/LOAD1/History/Rohdaten';
@files = glob("$srcdir/*.EXP");
foreach $inputfile(@files)
R. Favre
------------------------------
Date: 6 Mar 2003 10:04:59 -0800
From: bsnyder030174@yahoo.com (Brian Snyder)
Subject: Help with Inline::CPP....
Message-Id: <668c9529.0303060710.35de8312@posting.google.com>
(First off, let me say this is a duplicate of a post I made to
perl.inline newsgroup -- but that seems to be a dead group, so I
thougth I'd try here)
Hi all,
I have successfully installed the latest, Inline, Inline::C, and
Parse::RecDescent from CPAN and gone through the C Cookbook --
everything is working fine.
Then I tried to install the Inline::CPP module from CPAN, and I
thought the install worked fine -- at least the make process showed no
errors. I have perl 5.6 on linux RH8.
Note: I have the following Inline related files/dirs after the
installs:
/usr/lib/perl5/site_perl/5.6.0/Inline.pm
...../Inline/denter.pm
...../Inline/CPP.pod
...../Inline/Foo.pm
...../Inline/C.pm
...../Inline/C-Cookbook.pod
...../Inline/MakeMaker.pm
...../Inline/C.pod
...../Inline/MakeMaker/ {with files
underneath}
...../Inline/C/ {With files underneath}
...../Inline/CPP.pm
...../Inline/CPP/ {With files underneath}
So it seems as if everything is installed correctly, but when I try
and run the 'farmer' example from the help files I get the following
error printed out:::::
-------------------------------------------------------------------
Error. You have specified 'CPP' as an Inline programming language.
I currently only know about the following languages:
C, Foo, foo
If you have installed a support module for this language, try deleting
the
config file from the following Inline DIRECTORY, and run again:
/home/bsnyder/inline/_Inline
at ./gcp.pl line 0
INIT failed--call queue aborted.
---------------------------------------------------------------------
As mentioned my file gcp.pl is the farmer example from the
documention.
Thanks for any help,
---brian
------------------------------
Date: 6 Mar 2003 09:09:22 -0800
From: genericax@hotmail.com (Sara)
Subject: Re: How can I write this regex?
Message-Id: <776e0325.0303060455.3ec32a51@posting.google.com>
aserbin@yahoo.com (aserbin) wrote in message news:<21adf8db.0303051928.77f07cb5@posting.google.com>...
> > replace "dog" with "canine" if dog is not preceeded by "cat " or
> > "mouse ".
>
> i had to do something similar once and i just did this:
>
>
> $a = "cat dog and monkey dog and mouse dog";
> $a =~ s/(cat|mouse) (dog)/$1 nobodywouldeverusethisinputisurehope/g;
> $a =~ s/(\w+) dog/$1 canine/g;
> $a =~ s/nobodywouldeverusethisinputisurehope/dog/g;
>
> print $a;
>
>
> now i'm going to run and hide before the gurus yell at me.
hahaha.. Thanks for this I needed a good laugh today! Hey guru's be
nice to him at least he gave it a shot!
>
> $_=qq kycaens!k;reverse;s|c|k|;print;#drat!
Thanks for the suggestion. I sometimes resort to these kinds of
solutions based on rarity, but in this case, I run into this situation
often enough to where I'm like a formal solution.
-Gx
------------------------------
Date: 6 Mar 2003 09:49:15 -0800
From: genericax@hotmail.com (Sara)
Subject: Re: How can I write this regex?
Message-Id: <776e0325.0303060459.5625faca@posting.google.com>
Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3E66DF42.E3A1B29C@earthlink.net>...
> Sara wrote:
> >
> > Occasionally I need to change patterns which are NOT preceeded (or
> > followed, same difference) by certain other patterns. For example:
> >
> > replace "dog" with "canine" if dog is not preceeded by "cat " or
> > "mouse ".
>
> s/(?!<cat )(?!<mouse )dog/canine/g;
>
>
> For "not followed by", the syntax is (?=stuff here).
That is TOO COOL, thanks Benjamin. That's just the ticket- I knew I'd
seen it somewhere.
You did your good deed for the week :)
-Gx
------------------------------
Date: Thu, 06 Mar 2003 10:21:07 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: I want to know the line n umber of the error !
Message-Id: <Xns93367358953ABsdn.comcast@216.166.71.239>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Eric Osman <ericosman-nospam@rcn.com> wrote in
news:3E66635A.8060105@rcn.com:
> Here's my program so far:
>
> sub readPostInput() {
> my (%searchField, $buffer, $pair, @pairs);
> if ($ENV{'REQUEST_METHOD'} eq 'POST') {
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/,$buffer);
> foreach $pair (@pairs) {
> ($name, $value) = split(/=/, $pair);
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",
hex($1))/eg;
> $name =~ tr/+/ /;
> $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",
hex($1))/eg;
> $searchField{$name} = $value;
> }
> }
> return (%searchField);
> }
Do NOT attempt to parse CGI input yourself. Only geniuses and morons
do that -- and the geniuses don't do that unless they have a VERY
good reason.
Your routine, for example, doesn't parse variable pairs if they are
separated with ';', which they may well be. It doesn't take into
consideration the content encoding. It does not limit the quantity
of data returned, leaving your server vulnerable to DOS attacks. It
does not handle variables whose values contain a literal '='. It does
no error checking.
Use the CGI module like God intended you to. If you use CGI.pm, you
a) won't have to worry about any of the above problems; b) will be
using functions that have been thoroughly debugged and tested
hundreds of millions of times; c) won't have to worry about whether
the data was sent with POST or GET; d) will be able to debug/test
your program in a non-cgi environment (ie on the command-line).
WHY do people insist on reinventing the wheel?? You may as well try
to carve your own fuel injector out of wood for your car instead of
going down to the auto parts store and buying one off the shelf.
- --
Eric
print scalar reverse sort qw p ekca lre reh
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13
iD8DBQE+Z3U8Y96i4h5M0egRAjBXAKDkL4AEyL9pjN5L0ePje+PmZqz6eQCglzlV
+UM5DsgFh7JtgzhvNZGfZAw=
=unJS
-----END PGP SIGNATURE-----
------------------------------
Date: Thu, 06 Mar 2003 10:24:29 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: I want to know the line n umber of the error !
Message-Id: <Xns933673EAAA680sdn.comcast@216.166.71.239>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Eric Osman <ericosman-nospam@rcn.com> wrote in
news:3E6764B9.4050305@rcn.com:
> Someone asked why I don't debug my perl script locally before
putting
> it on RCN's server.
>
> Well, right now, the perl script depends on a "method = post"
> directive in the html code to send the script the stuff it
expects.
>
> So for one thing, to test the script locally, I'd need to figure
out
> how to "fake up" some posted data.
>
> I could avoid having to fake up posted data if I ran an actual web
> server on my local computer, which I don't currently.
>
> Thirdly, I'm not even currently running a perl
compiler/interpreter
> on my local machine. (perhaps you can suggest which ones are
> preferrable to run ? I'm on xp right now ).
>
> Anyway, for all the above reasons, I currently just ftp my scripts
> to RCN's server and try them there.
You've chosen an awfully difficult way to learn Perl. Why not make
things easier on yourself by installing Perl and Apache on your local
machine, so you can play around to your heart's content?
- --
Eric
print scalar reverse sort qw p ekca lre reh
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13
iD8DBQE+Z3YLY96i4h5M0egRAgeZAKDgJbiwueQkZwV/N3cGMDstyyaqfgCg5Ot9
OTwijrXHY/O/Y+UZ+5pooXs=
=uJ/Z
-----END PGP SIGNATURE-----
------------------------------
Date: Thu, 06 Mar 2003 19:42:25 +0100
From: "Tore Aursand" <tore@aursand.no>
Subject: Re: I want to know the line n umber of the error !
Message-Id: <pan.2003.03.06.18.26.50.455586@aursand.no>
On Thu, 06 Mar 2003 10:09:45 -0500, Eric Osman wrote:
> Well, right now, the perl script depends on a "method = post" directive
> in the html code to send the script the stuff it expects.
That's not a problem; You can run your script from the command line and
append whatever parameters you want to.
> So for one thing, to test the script locally, I'd need to figure out how
> to "fake up" some posted data.
Of course, that could be cumbersome. That's why you should install
everything necessary to test your script locally before uploading them to
the server.
I strongly recommend installing Apache [1] and ActiveState Perl [2] or
IndigoPerl [3]. The latter comes with a pre-compiled Apache for Win32.
[1] http://www.apache.org/
[2] http://www.activestate.com/
[3] http://www.indigostar.com/
> Anyway, for all the above reasons, I currently just ftp my scripts to
> RCN's server and try them there.
...which gives you a lot of headache, abviously. Depending on your
connection speed, you'll be up and running with Perl + Apache in less than
thirty minutes after downloading from the URL's above.
> Oh, one more thing. You've mentioned the "server log file" a number of
> times. I've been assumeing that since I'm only one of many RCN
> customers, they're not going to allow me to see their server log file,
> due to privacy and security issues.
It depends; If you have your own domain name, RCN _should_ have assigned
all server logging for that domain to their own files.
--
Tore Aursand <tore@aursand.no>
------------------------------
Date: Thu, 06 Mar 2003 10:33:58 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Lightweight CGI module?
Message-Id: <Xns93367585B5155sdn.comcast@216.166.71.239>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
"Tore Aursand" <tore@aursand.no> wrote in
news:pan.2003.03.06.09.05.11.375765@aursand.no:
> What's the status on lightweight CGI modules?
>
> The reason I'm asking, is that I'm working on a project where
we've
> come to the part of tuning the application for best possible
> performance.
>
> The CGI module (CGI.pm) _is_ a bottleneck here; it's far too heavy
for
> what we're using it for. In fact, only the CGI related features
of
> the CGI module is being used.
Why do you think CGI.pm is slowing you down? It's a huge module, but
nearly all of it is AUTOLOADed and thus is only compiled when it's
needed.
I would venture to guess (and it's only a guess) that your problem is
the whole CGI startup process -- the server forking/execing perl, the
perl binary loading into memory if it's not already cached, perl
compiling your program.
Of the major cgi technologies (plain CGI, PHP, fastcgi, mod_perl,
jsp, asp, etc), plain CGI is by FAR the slowest.
If speed is your main concern, I suggest you move to fastcgi. If you
also want or need control over the Apache process, move to mod_perl.
- --
Eric
print scalar reverse sort qw p ekca lre reh
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13
iD8DBQE+Z3hCY96i4h5M0egRAo9bAKCBZ70Eol2sOxzr+9/hP9At8bamTgCfRL3L
S2UjgyhVoUw70ATNPftMR90=
=NWFI
-----END PGP SIGNATURE-----
------------------------------
Date: Thu, 06 Mar 2003 10:36:45 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Lightweight CGI module?
Message-Id: <Xns933675FE87B1Esdn.comcast@216.166.71.239>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
"Tore Aursand" <tore@aursand.no> wrote in
news:pan.2003.03.06.14.55.20.180876@aursand.no:
> Yes, but I don't intend to have this run as "normal CGI". The
> application is _fast_ as long as it is running on a platform where
I
> can cache objects (for example the database connection) in memory;
>
> unless ( defined $dbh ) {
> # connect
> }
> $self->{'_dbh'} = $dbh;
>
> That's my programming style. Works on all platforms, and it gives
> better performance as long as it's possible to creata a
> "semi-persistent memory envirnoment" (or something like that).
How do you plan to do this when your program starts over again each
time it's invoked, which is what web servers do with CGI programs?
- --
Eric
print scalar reverse sort qw p ekca lre reh
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13
iD8DBQE+Z3jqY96i4h5M0egRAhiOAKCr4UrTXLHvaUPJNZqp/JMu6250wwCg8UQd
o5acQQwvIU79ZEktR/WwwHc=
=oXSN
-----END PGP SIGNATURE-----
------------------------------
Date: Thu, 6 Mar 2003 17:34:57 +0100
From: "henq" <hvtijen@hotwail.com>
Subject: Re: Lightweight CGI module?
Message-Id: <3e67792d$0$23903$8fcfb86b@news.wanadoo.nl>
* really consider PersistentPerl (aka SpeediCGI, mentioned elsewhere), it
runs under normal user privileges and gives you the most important benefit
of mod_perl: no start-up overhead
* www.gossamer-threads.com have their own lightweight CGI module I remember,
perhaps you may use/licence it. You can examine it by downloading one of
their free packages. (good perl quality, by the way).
~henq
"Tore Aursand" <tore@aursand.no> schreef in bericht
news:pan.2003.03.06.09.05.11.375765@aursand.no...
> What's the status on lightweight CGI modules?
>
> The reason I'm asking, is that I'm working on a project where we've come
> to the part of tuning the application for best possible performance.
>
> The CGI module (CGI.pm) _is_ a bottleneck here; it's far too heavy for
> what we're using it for. In fact, only the CGI related features of the
> CGI module is being used.
>
> What we need is a module that takes care of _only_ the following:
>
> o Getting request values (ie. the 'param()' method)
> o Getting/setting cookies
> o Printing out nice/valid HTTP headers
>
> Apache::* can't be used here, as the application _will_ be run on lots of
> different OS'es _and_ under lots of different web servers; Linux, Windows,
> IIS, Apache, you name it.
>
> A search on CPAN unveiled some potential modules, but all (ie. the few I
> found) seems to be outdated (ie. not updated for a few years).
>
> I've been playing around with extracting just the things we need from
> CGI.pm and put it a standalone module. This resulted in some quite
> "shocking" benchmark results, as only _initialising_ the standalone module
> is 400-500 percent faster than CGI.pm. With "initialising" I really mean:
>
> #!/usr/bin/perl
> #
> use strict;
> use warnings;
>
> use CGI (:cgi);
> use CGI::Lightweight; # own module
>
> my $cgi = CGI->new();
> my $cgi_lw = CGI::Lightweight->new();
>
> Question: What should I do? Is there ways of getting better performance
> out of CGI.pm that I'm missing?
>
> Thanks for any answer!
>
>
> --
> Tore Aursand <tore@aursand.no>
>
------------------------------
Date: Thu, 6 Mar 2003 12:50:36 -0500
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: Lightweight CGI module?
Message-Id: <5dCcnXcZ_ZIiF_qjXTWcqQ@giganews.com>
"Tore Aursand" <tore@aursand.no> wrote in message
news:pan.2003.03.06.14.55.20.180876@aursand.no...
> On Thu, 06 Mar 2003 13:55:25 +0100, Malte Ubl wrote:
> > Well, if you care about performance you should still use mod_perl
> > under Apache.
>
> I care about performance, but I still don't have the chance to use
> mod_perl in this case. I don't see that getting the best performance out
> of your application as it is requires you to choose OS _and/or_ web
> server.
>
> I want the best of two worlds here, if possible; Being able to run under
> any OS and web server (well, at least as many combinations as possible)
> and an application giving the best performance as possible.
If people care about performance, they will use mod_perl/Fast_CGI/whatever
and increase performance by an order of magnitude. In this case, the choice
of CGI modules is largely irrelavent since startup time is not a factor. If
someone doesn't care about performance and chooses not to use a persistent
interpreter solution, I really doubt they will care about the few
milliseconds that are saved. This means that the only audience that will
apprecieate your performance enhancements is the small group that does care
about speed, but cannot or will not upgrade their web server. There are the
people who want their Perl 4 script debugged... you just can't make everyone
happy. Personally, I'd rather serve the larger world by solidifying/adding
features then serve a small group of people with micro optimizations only
they will care about.
--Ben Kennedy
------------------------------
Date: Thu, 06 Mar 2003 19:42:25 +0100
From: "Tore Aursand" <tore@aursand.no>
Subject: Re: Lightweight CGI module?
Message-Id: <pan.2003.03.06.18.31.09.220267@aursand.no>
On Thu, 06 Mar 2003 16:49:56 +0100, Malte Ubl wrote:
> I though you couldnt use mod_perl?
I can't. I just make sure that I don't create objects if they're already
created (and exists in memory).
> But you don't want to use Cache::Cache to cache your database handle, do
> you?
No, that's not necessary.
> mod_perl runs on almost any platform that Apache runs on. Why not use
> mod_perl if the server is Apache?
I'm not in charge of the web server part. The "customer" is either
already running a web server (ie. won't switch to anything else), or is
running Windows (ie. prefers IIS no matter how bad it is).
--
Tore Aursand <tore@aursand.no>
------------------------------
Date: Thu, 06 Mar 2003 19:42:25 +0100
From: "Tore Aursand" <tore@aursand.no>
Subject: Re: Lightweight CGI module?
Message-Id: <pan.2003.03.06.18.33.16.486630@aursand.no>
On Thu, 06 Mar 2003 10:36:45 -0600, Eric J. Roode wrote:
>> unless ( defined $dbh ) {
>> # connect
>> }
>> $self->{'_dbh'} = $dbh;
> How do you plan to do this when your program starts over again each time
> it's invoked, which is what web servers do with CGI programs?
If I'm so lucky that the web server _is_ running mod_perl or PerlEx,
that's not a problem; The database handle (above) will be stored in
memory.
I don't have any experience with other "fast CGI" solutions like FastCGI
or SpeedyCGI. Maybe I should take a look at them.
--
Tore Aursand <tore@aursand.no>
------------------------------
Date: Thu, 06 Mar 2003 19:42:25 +0100
From: "Tore Aursand" <tore@aursand.no>
Subject: Re: Lightweight CGI module?
Message-Id: <pan.2003.03.06.18.38.53.925147@aursand.no>
On Thu, 06 Mar 2003 12:50:36 -0500, Ben Kennedy wrote:
>> I want the best of two worlds here, if possible; Being able to run
>> under any OS and web server (well, at least as many combinations as
>> possible) and an application giving the best performance as possible.
> If people care about performance, they will use
> mod_perl/Fast_CGI/whatever and increase performance by an order of
> magnitude. In this case, the choice of CGI modules is largely
> irrelavent since startup time is not a factor. If someone doesn't care
> about performance and chooses not to use a persistent interpreter
> solution, I really doubt they will care about the few milliseconds that
> are saved.
I think you're missing my main point here; I'm only talking about the CGI
module here; "All" the other modules I can somehow cache in memory, so I
don't care about them.
The CGI module, however, can't be cached as I need the fresh parameters on
each startup. I can't compile it either, as I won't be running this thing
under mod_perl (for the most of the time, I guess).
I guess that it _probably_ is possible to make the application check if
it's running under mod_perl, and with that in mind compile the CGI module.
But that regards only to mod_perl installations. I won't be running
mod_perl in more than approx. 10-15% of the installations of this
application.
And - I'm not _really_ that much concerned about the performance; I just
see that just _loading_ CGI.pm takes too long compared to "everything
else". So I want to remove the CGI.pm bottleneck. :)
--
Tore Aursand <tore@aursand.no>
------------------------------
Date: Thu, 6 Mar 2003 12:17:48 -0500
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: New module proposed: Class::Accessor::NoviceArray
Message-Id: <pi2dnedIWNWSHvqjXTWcog@giganews.com>
"Ronald Schmidt" <RonaldWS@software-path.com> wrote in message
news:86f16f82.0303051838.3137813e@posting.google.com...
> I am proposing to add a new module to CPAN as described by the POD
> documentation below. I am interested in comments with regard to
> the module name which is Class::Accessor::NoviceArray and comments
> on the names of the utility modules which are
> Class::Accessor::NoviceArrayManip and
Class::Accessor::NoviceArrayReadonly.
>
> I am also very much interested in comments regarding other modules that
> may fill the same purpose and to what degree these modules fill a
> significant need in Perl programming. From the POD:
The Class::MethodMaker module allows you to create list-style accessors,
e.g. foo_push, foo_pop, etc. As for as I can tell though, there are no
options for a read-only list.
--Ben Kennedy
------------------------------
Date: 6 Mar 2003 09:27:12 -0800
From: Crapnut566@yahoo.com (Nataku)
Subject: Re: perl locks up my win98 computer
Message-Id: <7e48fc99.0303060800.62dfb544@posting.google.com>
I would imagine that since you are running Win98, you probably dont
have too much RAM on your system. This could be the cause. Im
assuming you have the correct distrobution via activestate.
Ignore all the MS cynicism that is present near everywhere. I have
never had a problem running perl under windows myself. Im guessing
its either hardware, or a specific issue with your windows install.
Sorry I cant be of much help, but OS lockups are hard to diagnose.
James McIninch <james.mcininch@attbi.com> wrote in message news:<NHB9a.378452$Ec4.380535@rwcrnsc52.ops.asp.att.net>...
> On Wednesday 05 March 2003 07:15 pm, Doglover posted to comp.lang.perl.misc:
>
> > Hi. Does anyone know why Perl locks up my win98 machine when I do
> > simple things like type PPM, or perldoc perldoc?
>
> This is a feature of Microsoft Windows. It's one of the things that
> differntiates it from other operating system products on the market.
>
>
> > Can't even do
> > control-alt-delete. It is totally locked. Simple "hello world" scripts
> > run fine. Seems to be with both 5.6.1 and with 5.8.0, since I tried
> > both. Strange, because 5.6 used to work. Then I tried 5.8, and started
> > locking up. Uninstalled, and went back to 5.6, still locked up. So now
> > I am back at 5.8.
> >
> > A google search revealed almost nothing.
------------------------------
Date: Thu, 06 Mar 2003 18:13:05 +0100
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: Perl Vs Python
Message-Id: <930f6vsg4c6d78gbe69c2dfvmiactvqd9e@4ax.com>
X-Ftn-To: Cameron Laird
claird@lairds.com (Cameron Laird) wrote:
>In article <b3kkdl$fvl$1@news.peterlink.ru>,
>Anton Muhin <antonmuhin@sendmail.ru> wrote:
>>If you are interested, there is really nice book about text processing
>>in Python (I don't remember URL :().
> .
> .
>Sean McGrath's *XML Processing with Python*?
Yes, but anyway who would pick Python over Perl(or Ruby?) for text
processing? <evil grin> :)
--
Matija
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 4674
***************************************