[30818] in Perl-Users-Digest
Perl-Users Digest, Issue: 2063 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 18 03:09:45 2008
Date: Thu, 18 Dec 2008 00:09:09 -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, 18 Dec 2008 Volume: 11 Number: 2063
Today's topics:
Re: a simple control in an nntp client <hansmu@xs4all.nl>
Re: a simple control in an nntp client <1usa@llenroc.ude.invalid>
Re: a simple control in an nntp client <george@example.invalid>
Re: a simple control in an nntp client <george@example.invalid>
Re: a simple control in an nntp client <jurgenex@hotmail.com>
Re: Help with DOS file names <jurgenex@hotmail.com>
Re: mathematical operation in a perl one liner in subst <tadmc@seesig.invalid>
Re: mathematical operation in a perl one liner in subst <uri@stemsystems.com>
Re: mathematical operation in a perl one liner in subst <tim@burlyhost.com>
Re: mathematical operation in a perl one liner in subst <uri@stemsystems.com>
Re: mathematical operation in a perl one liner in subst <jurgenex@hotmail.com>
Re: MIME::Lite -- Add attribute to part's Content-Type <fake@phony.invalid>
Re: multidimensional array <news@kappacher.com>
new CPAN modules on Thu Dec 18 2008 (Randal Schwartz)
Re: speeding up cgi perl <skeldoy@gmail.com>
Re: speeding up cgi perl <skeldoy@gmail.com>
Re: speeding up cgi perl <skeldoy@gmail.com>
Re: speeding up cgi perl <bart.lateur@pandora.be>
Suggestions for distributing my Perl program <freesoft12@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 Dec 2008 23:03:50 +0100
From: Hans Mulder <hansmu@xs4all.nl>
Subject: Re: a simple control in an nntp client
Message-Id: <49497850$0$199$e4fe514c@news.xs4all.nl>
Jürgen Exner wrote:
> George <george@example.invalid> wrote:
>> I never understood the shebang line on windows.
>
> It is ignored except that perl (but not the command shell!) still reads
> and interprets options.
Are you sure?
Last time I payed attention, perl would also read the path and try
to run the program indicated. So if your script begins with:
#!/bin/sh
, then perl will try to exec /bin/sh (which is unlikely to succeed
on windows). Perl doesn't do this if the string "perl" occurs
anywhere on the shebang line.
At least, this is what my copy of perlrun says. I do not have a
Windows machine at hand to try it.
-- HansM
------------------------------
Date: Thu, 18 Dec 2008 00:25:35 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: a simple control in an nntp client
Message-Id: <Xns9B77C59D85A76asu1cornelledu@127.0.0.1>
Tony Mc <afmcc@btinternet.com> wrote in
news:8klhk4d68fdgboj6nfo9loci947p0cu8rr@4ax.com:
> On Tue, 16 Dec 2008 20:52:23 -0800, Jürgen Exner
> <jurgenex@hotmail.com> wrote:
>
>> George <george@example.invalid> wrote:
>> >I never understood the shebang line on windows.
>>
>> It is ignored except that perl (but not the command shell!) still reads
>> and interprets options.
>
> I seem to recall that it's also useful if you are running an Apache
> server on Windows and need to execute perl CGI scripts. Apache does
> use the shebang line.
That behavior can be controlled using a directive:
http://httpd.apache.org/docs/2.2/mod/core.html#scriptinterpretersource
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Wed, 17 Dec 2008 20:25:14 -0700
From: George <george@example.invalid>
Subject: Re: a simple control in an nntp client
Message-Id: <rh8xf1u9pfd6.kdus7q1w7jmr.dlg@40tude.net>
On Wed, 17 Dec 2008 23:03:50 +0100, Hans Mulder wrote:
> Jürgen Exner wrote:
>> George <george@example.invalid> wrote:
>>> I never understood the shebang line on windows.
>>
>> It is ignored except that perl (but not the command shell!) still reads
>> and interprets options.
>
> Are you sure?
>
> Last time I payed attention, perl would also read the path and try
> to run the program indicated. So if your script begins with:
>
> #!/bin/sh
>
> , then perl will try to exec /bin/sh (which is unlikely to succeed
> on windows). Perl doesn't do this if the string "perl" occurs
> anywhere on the shebang line.
>
> At least, this is what my copy of perlrun says. I do not have a
> Windows machine at hand to try it.
>
> -- HansM
Give me a test. I'll run it and get back to you.
I haven't discovered the circumstance where shebang is relevant.
--
George
I believe that God has planted in every heart the desire to live in
freedom.
George W. Bush
Picture of the Day http://apod.nasa.gov/apod/
------------------------------
Date: Wed, 17 Dec 2008 20:34:33 -0700
From: George <george@example.invalid>
Subject: Re: a simple control in an nntp client
Message-Id: <t6zgobm4szw3.qehz3rlubx42$.dlg@40tude.net>
On Tue, 16 Dec 2008 20:55:40 -0800, Jürgen Exner wrote:
> George <george@example.invalid> wrote:
>>On Tue, 16 Dec 2008 06:10:17 -0600, Tad J McClellan wrote:
>>> The problem was simply a programmer's logic error.
>>
>>No. I bought the camel book 15 months ago and am not mature with the
>>syntax.
>
> $_ has _NOTHING_ to do with syntax. It is simply a normal variable,
> which happens to be used as default in many Perl commands if you don't
> [explicitly] specify a different variable. But as mentioned by Tad
> already that is semantic, not syntax.
>
> jue
Perl is a programming syntax defined by a single implementation. $_ is a
syntactic element of perl. My ongoing difficulty--somewhat allayed by this
thread--is how $_ fits in with loops, which are semantic.
You can argue, reductionistically, that everything boils down to syntax, in
the same way that it boils down to ones and zeroes.
--
George
America must not ignore the threat gathering against us. Facing clear
evidence of peril, we cannot wait for the final proof, the smoking gun that
could come in the form of a mushroom cloud.
George W. Bush
Picture of the Day http://apod.nasa.gov/apod/
------------------------------
Date: Wed, 17 Dec 2008 22:46:46 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: a simple control in an nntp client
Message-Id: <gtrjk49khoum6mant2ucuv2158b573nikc@4ax.com>
George <george@example.invalid> wrote:
>Perl is a programming syntax defined by a single implementation.
Hmmmm, no. Perl is a programming language which consists of grammar (aka
syntax), context rules, and semantic.
>$_ is a syntactic element of perl.
A variable could be considered a syntactical element as a special case
of an expression. But that would be true for any variable, not just for
$_.
As far as the syntax, context, or even semantic is concerned $_ is just
a good old plain variable, nothing special about it at all. As I said
before, it just happens that many functions use $_ as the default if you
don't specify your own variable. But that has nothing to do with syntax.
>My ongoing difficulty--somewhat allayed by this
>thread--is how $_ fits in with loops, which are semantic.
Loops are not just semantic. They have syntax, context, and semantic
components, just like (almost) every other Perl langauge construct.
And again, $_ is just another variable. You could use $foo or $bar or
$mygreatprivatsecretvariable instead and nothing would change.
>You can argue, reductionistically, that everything boils down to syntax, in
>the same way that it boils down to ones and zeroes.
Actually I am arguing the opposite way: $_ has nothing to do with
syntax. Neither the tokenizer nor the parser cares if you you are using
$_ or $foo or $mygreatprivatsecretvariable, therefore $_ cannot be a
syntactical issue.
jue
------------------------------
Date: Wed, 17 Dec 2008 13:19:04 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Help with DOS file names
Message-Id: <clqik411ajsusfk3bvrngv53v1ejhnvtlb@4ax.com>
"souporpower@gmail.com" <soup_or_power@yahoo.com> wrote:
>This is my code to print the URL's from the browser favorites:
>
>my @dirs = `dir`;
perldoc -f opendir/readdir
perldoc -f glob
>my $f;
>foreach $f (@dirs) {
> next if ($f =~ /url/);
> `cd $f`;
What is this `cd` supposed to do? It will start a new process (via
backticks, then change the CWD of that process, and then close the
process. Unless I am missing something that seems pretty pointless to
me.
> print "Dir=" . $f . "\n";
> my @files=`dir *.url`;
perldoc -f glob
[rest of code snipped]
>The problem is each file returned by the DOS dir command has carriage
Well, then don't use that stupid external command but Perl's buildin
utilities aka glob() or opendir/readdir.
>returns at the beginning of the file name (can't use chop or chomp).
If you want to you could. Just reverse(), chomp(), reverse(). But I'm
not recommending to do that.
>Can someone please help me
>out? Tried $f =~ s/^\\n//g;
That would replace a literal backslash followed by a 'n'. Don't escape
the backslash.
Or specify the offending character by its numerical value, using the \x
or \0 notation, see perldoc perlre for details.
jue
------------------------------
Date: Wed, 17 Dec 2008 15:14:27 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: mathematical operation in a perl one liner in substitute
Message-Id: <slrngkiqtj.4gc.tadmc@tadmc30.sbcglobal.net>
John W. Krahn <someone@example.com> wrote:
> " | perl -pe's{(;\s*)(\d+)}{$1.($2/10)}e'
I just want to say that that is some beautiful code.
heh.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Wed, 17 Dec 2008 19:23:44 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: mathematical operation in a perl one liner in substitute
Message-Id: <x7wsdy49gv.fsf@stemsystems.com>
>>>>> "TJM" == Tad J McClellan <tadmc@seesig.invalid> writes:
TJM> John W. Krahn <someone@example.com> wrote:
>> " | perl -pe's{(;\s*)(\d+)}{$1.($2/10)}e'
TJM> I just want to say that that is some beautiful code.
didn't anyone smell homework here? might as well golf it since the
teacher would never expect that from a newbie!
there is no mention of other fields, numbers other than integers, etc.
perl -pe's{(\d+)}{$1/10}e'
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Wed, 17 Dec 2008 16:38:32 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: mathematical operation in a perl one liner in substitute
Message-Id: <cYg2l.42$bZ5.4@newsfe02.iad>
Uri Guttman wrote:
>>>>>> "TJM" == Tad J McClellan <tadmc@seesig.invalid> writes:
>
> TJM> John W. Krahn <someone@example.com> wrote:
> >> " | perl -pe's{(;\s*)(\d+)}{$1.($2/10)}e'
>
> TJM> I just want to say that that is some beautiful code.
>
> didn't anyone smell homework here? might as well golf it since the
> teacher would never expect that from a newbie!
>
> there is no mention of other fields, numbers other than integers, etc.
>
> perl -pe's{(\d+)}{$1/10}e'
>
> uri
>
Actually, out of curiosity, are there any classes that would have
homework that actually use Perl code for problem solving? I'm being
genuine about this question.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
------------------------------
Date: Wed, 17 Dec 2008 23:29:44 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: mathematical operation in a perl one liner in substitute
Message-Id: <x7prjq2jif.fsf@stemsystems.com>
>>>>> "TG" == Tim Greer <tim@burlyhost.com> writes:
TG> Uri Guttman wrote:
>> didn't anyone smell homework here? might as well golf it since the
>> teacher would never expect that from a newbie!
TG> Actually, out of curiosity, are there any classes that would have
TG> homework that actually use Perl code for problem solving? I'm being
TG> genuine about this question.
just google this group or the perl beginner's list for homework. many
time obvious homework problems have been posted and usually labeled as
such by repliers (never by the OP). the problems have simple goals,
contrived data (like this one), etc. many times the problem states a
desired solution technique which is bogus (e.g. you must use a regex to
solve this). and if accused of posting homework, the OP will usually
defend it in some silly way.
as for the actual classes, yes, some colleges (community ones in
particular but others too) do teach SOME perl. this may be in a
'programming languages' class which flashes the students with snippets
of different langs but no real understanding. or an intro to perl class
taught by someone who doesn't know (or like!) perl very much. perl is
not taught as a mainstream language like java/c++ since those have more
jobs out there and colleges like to teach to the job market.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Wed, 17 Dec 2008 22:51:29 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: mathematical operation in a perl one liner in substitute
Message-Id: <qgsjk4lthn1b9tng86n13vvmt48u7gc9je@4ax.com>
Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "TG" == Tim Greer <tim@burlyhost.com> writes:
>
> TG> Uri Guttman wrote:
>
> >> didn't anyone smell homework here? might as well golf it since the
> >> teacher would never expect that from a newbie!
>
> TG> Actually, out of curiosity, are there any classes that would have
> TG> homework that actually use Perl code for problem solving? I'm being
> TG> genuine about this question.
>
>just google this group or the perl beginner's list for homework. many
>time obvious homework problems have been posted and usually labeled as
>such by repliers (never by the OP). the problems have simple goals,
>contrived data (like this one), etc. many times the problem states a
>desired solution technique which is bogus (e.g. you must use a regex to
>solve this). and if accused of posting homework, the OP will usually
>defend it in some silly way.
Hmmmm, I am not sure I totally agree. Certainly there are those cases
you mentioned, no doubt about it.
On the other hand the OPs problem could also be viewed as a perfect
excerpt from a larger project, stripped down to the bare minimum code
required to exhibit the problem, just like requested in the posting
guidelines.
jue
------------------------------
Date: Wed, 17 Dec 2008 20:25:11 -0700
From: Shawn N Blank <fake@phony.invalid>
Subject: Re: MIME::Lite -- Add attribute to part's Content-Type
Message-Id: <krfjk4te2ar71cc8tlrct3gupca6klc8ib@4ax.com>
On Sat, 13 Dec 2008 21:11:37 -0800 (PST), Jerry Krinock
<jerry@ieee.org> wrote:
>Second Attempt: Assuming that attach() would return the part (which is
>undocumented), I tried to invoke 'attr' on the part. At least this
>makes sense:
>
> my $fileAttachmentPart = $msg->attach(
> Type => 'application/zip',
> Path => $myScriptPath,
> Filename => "MyScript.app.zip"
> ) ;
> $fileAttachmentPart->attr("x-mac-auto-archive" => "yes");
Try
$fileAttachmentPart->attr("content-type.x-mac-auto-archive" => "yes");
SnB
------------------------------
Date: Wed, 17 Dec 2008 23:18:30 +0100
From: Johann Kappacher <news@kappacher.com>
Subject: Re: multidimensional array
Message-Id: <6d215$49497ab7$d52f8dcf$31123@news.chello.at>
taralee324 wrote:
> I know I've done this before... but for the life of me, I cannot
> recall how!
>
> I have an array of arrays (ie. $AoA[$array][$row][$col]). And I want
> to copy one array to a separate array variable. I've tried:
> @new_array = [$AoA[$array]];
> @new_array = {$AoA[$array]};
> and about a million other ways, but I can't find any online
> documentation (which is where I learn this stuff) on how to do it.
>
> Thanks for any help!
Hi, wait!
This is AoAoA (3dim) ...
What do you need, deep or shallow copy?
shallow: = @{ }
deep: hmmm, nested loops or special purpose perl modules.
bye, hannes
------------------------------
Date: Thu, 18 Dec 2008 05:42:24 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Dec 18 2008
Message-Id: <KC256o.r5H@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
App-Asciio-1.02.71
http://search.cpan.org/~nkh/App-Asciio-1.02.71/
Plain ASCII diagram
----
App-Options-1.06
http://search.cpan.org/~spadkins/App-Options-1.06/
Combine command line options, environment vars, and option file values (for program configuration)
----
Bundle-DBD-PO-2.02
http://search.cpan.org/~steffenw/Bundle-DBD-PO-2.02/
A bundle to install all DBD::PO related modules
----
Bundle-Perl6-0.12
http://search.cpan.org/~marcel/Bundle-Perl6-0.12/
A bundle to install Perl6-related modules
----
CPAN-Testers-Common-DBUtils-0.03
http://search.cpan.org/~barbie/CPAN-Testers-Common-DBUtils-0.03/
Basic Database Wrapper
----
CPAN-Testers-WWW-Reports-Mailer-0.09
http://search.cpan.org/~barbie/CPAN-Testers-WWW-Reports-Mailer-0.09/
CPAN Testers Reports Mailer
----
CPAN-Testers-WWW-Reports-Mailer-0.10
http://search.cpan.org/~barbie/CPAN-Testers-WWW-Reports-Mailer-0.10/
CPAN Testers Reports Mailer
----
Catalyst-Action-Fixup-XHTML-0.02
http://search.cpan.org/~fayland/Catalyst-Action-Fixup-XHTML-0.02/
Catalyst action which serves application/xhtml+xml content if the browser accepts it.
----
Catalyst-Authentication-Store-KiokuDB-0.01
http://search.cpan.org/~rberjon/Catalyst-Authentication-Store-KiokuDB-0.01/
KiokuDB store for auth
----
Catalyst-Model-File-0.07
http://search.cpan.org/~ash/Catalyst-Model-File-0.07/
File based storage model for Catalyst.
----
Catalyst-Plugin-Session-Store-KiokuDB-0.01
http://search.cpan.org/~rberjon/Catalyst-Plugin-Session-Store-KiokuDB-0.01/
Store sessions using KiokuDB
----
Config-General-2.41
http://search.cpan.org/~tlinden/Config-General-2.41/
Generic Config Module
----
Config-Hierarchical-0.13.9
http://search.cpan.org/~nkh/Config-Hierarchical-0.13.9/
Hierarchical configuration container
----
Crypt-Vernam-0.02
http://search.cpan.org/~gebele/Crypt-Vernam-0.02/
Perl implementation of the Vernam cipher
----
DBD-PO-2.02
http://search.cpan.org/~steffenw/DBD-PO-2.02/
DBI driver for PO files
----
DBIx-Class-InflateColumn-Path-Class-0.001001
http://search.cpan.org/~groditi/DBIx-Class-InflateColumn-Path-Class-0.001001/
inflate / deflate values into Path::Class::File or Path::Class::Dir objects
----
DJabberd-0.84
http://search.cpan.org/~mart/DJabberd-0.84/
scalable, extensible Jabber/XMPP server.
----
Directory-Scratch-Structured-0.04
http://search.cpan.org/~nkh/Directory-Scratch-Structured-0.04/
creates temporary files and directories from a structured description
----
File-Fetch-0.18
http://search.cpan.org/~kane/File-Fetch-0.18/
A generic file fetching mechanism
----
HTTP-Session-0.28
http://search.cpan.org/~tokuhirom/HTTP-Session-0.28/
simple session
----
IO-Lambda-0.46
http://search.cpan.org/~karasik/IO-Lambda-0.46/
non-blocking I/O in lambda style
----
JavaScript-Beautifier-0.01
http://search.cpan.org/~fayland/JavaScript-Beautifier-0.01/
Beautify Javascript (beautifier for javascript)
----
JavaScript-Beautifier-0.02
http://search.cpan.org/~fayland/JavaScript-Beautifier-0.02/
Beautify Javascript (beautifier for javascript)
----
JavaScript-Beautifier-0.03
http://search.cpan.org/~fayland/JavaScript-Beautifier-0.03/
Beautify Javascript (beautifier for javascript)
----
Judy-HS-0.01
http://search.cpan.org/~jjore/Judy-HS-0.01/
Library for creating and accessing a dynamic array, using an array-of-bytes of Length as an Index and a word as a Value.
----
MIME-Types-1.26
http://search.cpan.org/~markov/MIME-Types-1.26/
Definition of MIME types
----
Markapl-0.03
http://search.cpan.org/~gugod/Markapl-0.03/
Markup as Perl
----
Memcached-libmemcached-0.2501
http://search.cpan.org/~dmaki/Memcached-libmemcached-0.2501/
Thin fast full interface to the libmemcached client API
----
Module-Load-Conditional-0.28
http://search.cpan.org/~kane/Module-Load-Conditional-0.28/
Looking up module information / loading at runtime
----
MojoX-Fixup-XHTML-0.04
http://search.cpan.org/~fayland/MojoX-Fixup-XHTML-0.04/
serves application/xhtml+xml content for Mojo
----
MooseX-Emulate-Class-Accessor-Fast-0.00600
http://search.cpan.org/~groditi/MooseX-Emulate-Class-Accessor-Fast-0.00600/
Emulate Class::Accessor::Fast behavior using Moose attributes
----
MooseX-Types-Moose-Overload-0.01_02
http://search.cpan.org/~ecarroll/MooseX-Types-Moose-Overload-0.01_02/
Deal with overload, in the overloaded sense ;)
----
Muldis-D-0.54.0
http://search.cpan.org/~duncand/Muldis-D-0.54.0/
Formal spec of Muldis D relational DBMS lang
----
Net-OpenSSH-0.10
http://search.cpan.org/~salva/Net-OpenSSH-0.10/
Perl SSH client package implemented on top of OpenSSH
----
Net-SIP-0.52
http://search.cpan.org/~sullr/Net-SIP-0.52/
Framework SIP (Voice Over IP, RFC3261)
----
Net-fonolo-1.3
http://search.cpan.org/~mpultz/Net-fonolo-1.3/
Perl interface to fonolo (http://fonolo.com/developer)
----
PAR-Dist-0.41
http://search.cpan.org/~smueller/PAR-Dist-0.41/
Create and manipulate PAR distributions
----
POE-Component-Server-SimpleHTTP-1.50
http://search.cpan.org/~bingos/POE-Component-Server-SimpleHTTP-1.50/
Perl extension to serve HTTP requests in POE.
----
Passwd-Unix-0.46
http://search.cpan.org/~strzelec/Passwd-Unix-0.46/
----
Perl-Critic-Pulp-11
http://search.cpan.org/~kryde/Perl-Critic-Pulp-11/
some add-on perlcritic policies
----
Proc-Exists-0.92_01
http://search.cpan.org/~brianski/Proc-Exists-0.92_01/
quickly check for process existence
----
Proliphix-0.01
http://search.cpan.org/~nebulous/Proliphix-0.01/
Talks to Proliphix network thermostats
----
RPM2-0.68
http://search.cpan.org/~lkundrak/RPM2-0.68/
Perl bindings for the RPM Package Manager API
----
RT-Extension-ExtractCustomFieldValues-2.0
http://search.cpan.org/~alexmv/RT-Extension-ExtractCustomFieldValues-2.0/
----
Rose-DBx-Object-Indexed-0.003
http://search.cpan.org/~karman/Rose-DBx-Object-Indexed-0.003/
full-text search for RDBO classes
----
SNMP-Extension-PassPersist-0.03
http://search.cpan.org/~saper/SNMP-Extension-PassPersist-0.03/
Generic pass/pass_persist extension framework for Net-SNMP
----
Statistics-Descriptive-Weighted-0.3
http://search.cpan.org/~dhard/Statistics-Descriptive-Weighted-0.3/
Module of basic descriptive statistical functions for weighted variates.
----
Statistics-KernelEstimation-0.02
http://search.cpan.org/~janert/Statistics-KernelEstimation-0.02/
Kernel Density Estimates and Histograms
----
Statistics-KernelEstimation-0.03
http://search.cpan.org/~janert/Statistics-KernelEstimation-0.03/
Kernel Density Estimates and Histograms
----
Syntax-Highlight-Perl6-0.028
http://search.cpan.org/~azawawi/Syntax-Highlight-Perl6-0.028/
Perl 6 Syntax Highlighter
----
Syntax-Highlight-Perl6-0.029
http://search.cpan.org/~azawawi/Syntax-Highlight-Perl6-0.029/
Perl 6 Syntax Highlighter
----
Test-Script-1.04_02
http://search.cpan.org/~adamk/Test-Script-1.04_02/
Cross-platform basic tests for scripts
----
Test-WWW-Simple-0.28
http://search.cpan.org/~mcmahon/Test-WWW-Simple-0.28/
Test Web applications using TAP
----
WWW-Scraper-ISBN-ISBNdb_Driver-0.05
http://search.cpan.org/~diberri/WWW-Scraper-ISBN-ISBNdb_Driver-0.05/
isbndb.com driver for WWW::Scraper::ISBN
----
Workflow-0.32_7
http://search.cpan.org/~jonasbn/Workflow-0.32_7/
Simple, flexible system to implement workflows
----
YAML-Tiny-1.35
http://search.cpan.org/~adamk/YAML-Tiny-1.35/
Read/Write YAML files with as little code as possible
----
parrot-0.8.2
http://search.cpan.org/~chromatic/parrot-0.8.2/
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Wed, 17 Dec 2008 15:45:23 -0800 (PST)
From: skeldoy <skeldoy@gmail.com>
Subject: Re: speeding up cgi perl
Message-Id: <9ca565e1-19a3-4e07-bd09-15f1af545b54@p2g2000prf.googlegroups.com>
> ... why not just render the page once
> return static html? =A0You can schedule updates when the db changes.
I think that I am somewhat doing that with configuring the mysql to
cache almost everything it can. The server basically is just one big
mysql-cache and some memory for the cgi-process to run.. But I see
your point.. I can do it to test out if the browser may be the issue
------------------------------
Date: Wed, 17 Dec 2008 15:53:05 -0800 (PST)
From: skeldoy <skeldoy@gmail.com>
Subject: Re: speeding up cgi perl
Message-Id: <15ae8661-73d2-4bbf-b2ff-c8aa24f6a52b@f40g2000pri.googlegroups.com>
> You should use placeholders instead for security, but that won't affect
> speed much.
I know. But it is intended to be used by inhouse people, and if they
mess it up, I will just restore it. :)
> To find out where it spends the time, use Devel::NYTProf.
> The simplest method to use it is usually to just invoke it from the
> commandline:
> export REQUEST_METHOD=GET
> export QUERY_STRING='whatever'
> perl -d:NYTProf yourscript.cgi
> This creates a file nytprof.out in the current directory which you can
> convert to a nice HTML report with the nytprofhtml command.
> There are also other ways for invoking it, see the docs.
Good tip! I will try it out and see what it says. Thanks man, this is
really good stuff right there.
>
> CGI does have considerable overhead per row. However, for just 15000
> rows I'd still expect that to be finished in a few seconds at most.
I know! when I do a "mysql -u root \n select * from db" it returns
pretty much in the speed that my gfx-adapter can print it out, and
within a couple of secs if I pipe it to a file.
> Is 700 GB and 6 billion rows in the largest table huge enough? I don't
> use mysql for that one, though.
Is it a mysql issue that make you use another db?
> Since you wrote that your CGI script uses 95% CPU time during the time
> it runs it is unlikely to be a browser problem. But browsers in general
> are rather slow at rendering tables. For 15000 rows, the browser may
> easily take a few dozen seconds to render the table (depending on the
> speed of your workstation, how much memory you have, etc.) Try accessing
> the CGI with wget or a similar tool - is it much faster than with the
> browser?
A really good question. Never really thought about seeing whether the
data-transmission is the issue in that way.
Just another thing for me to do..
Really appreciate your time/help on this. Good pointers there. I got
pretty one lane looking at the code
and tuning the mysql there. Never occurred to me that there is basic
ways of testing the data-transmission (ie. curl/wget).
And the Devel::NYTProf package is a definate plus in finding the
culprit here. Thanks again! :)
------------------------------
Date: Wed, 17 Dec 2008 16:11:45 -0800 (PST)
From: skeldoy <skeldoy@gmail.com>
Subject: Re: speeding up cgi perl
Message-Id: <9f3f86d9-5948-4201-af15-e55280be2581@b38g2000prf.googlegroups.com>
> Isn't dupechecking more a back-office thing best done from the command
> line, not CGI?
I know. I got some very particular non-technical customers that wants
to oversee the entire process to spend time. I think the bureaucrats
have too little work and too much time on their hands. But hey! I
can't really tell them what THEY want to do, right? :)
> What does that mean? =A0$|=3D1? =A0mysql_use_result?
$|=3D1 on everything, everywhere. The mysql doesn't really buffer output
anymore, but the whole thing is in memory - so it is, as I said,
probably not the culprit.
> I wouldn't know how to identify *all* sources of buffering present in
> a complex system, let alone know how to disable them completely.
I know, but I thought there might be something trivial that I didn't
know about. Good to hear though.
> It takes less than a second to stream the entire <big_num> of data
> to your screen on the mysql-console? =A0Or do you somehow tell it to
> run the query but suppress the actual results?
If i render it on screen from the mysql - I get bottlenecked by the
graphics-adapter/Xorg. When I pipe it to a file it gets done in like a
couple of seconds, and I figure that is how long it really does to do
the query.
> Does the CGI have to be invoked by POST, or will GET work?
I use GET.
> Use wget to fetch the page. =A0See how long it takes when the results jus=
t
> have to fetched and stored and not rendered.
I will.
> And once you do that and have the results stored as a static file, you
> might as well put that in a location that is served up via http and open =
it
> with the client browser. =A0See how long does it take to pull the data ov=
er
> the net and render it in a browser when it is coming from a static file
> rather than a CGI.
The next step. I agree. I plainly just have to be more thorough.. See
your pointers there.
> You can try adding -d:DProf or -d:SmallProf (or you favorite profiler) to
> the CGI shebang line. =A0Or come up with an adapter run the CGI in a
> command-line environment, and profile it from there.
Yeah. Mister Peter mentioned a Devel::NYTProf that I intend to run.
But I will definatly try out DProf and SmallProf like you say.
Glad some of you actually know about these things (like profiling and
such other stuff that I am totally blind to).
> On most modern computers, 50MB is a rounding error. =A0Is that the case f=
or
> your computer?
? huh ? Is this a new feature of the VonNeumann machine that slipped
my attention?
> *Anything* can be done incorrectly, in which case there are things to be
> aware of. =A0Are you using multiple MySQL connections in your CGI? =A0If =
so,
> how are you doing it?
doing multiple "my $db1 =3D the connection stuff ; my $db2 =3D the
connection stuff ; my $db...
I open them all up in the beginning of the code and keep them over the
length of the run.
Strange thing is that when I parse the data into the DB I do it in the
exactly same manner and the
multiple connections speed that up. Can't really see how multiple
connections would suddenly be an issue,
but strange things happen in the Perl-world, so I have all
possibilities open.
>
> Profile, profile, profile. =A0If that doesn't work, comment out chunks
> of code and see if that affects speed (for example, do all the work excep=
t
> for the actual printing of the html table.)
Again with the profiling. I will man. Thanks for that. Never actually
been a profiling man. Just code and it normally works the way I
intended. Will definelty try it out now..
> If the CGI script itself is using 95% of a CPU, then it probably isn't
> a browser or network issue. =A0Unless your CPU utilization reporting tool
> accounts for I/O waits as CPU usage (I've seen some that do).
I don't really know. All I have done is run top on the linux-server
that runs it.
Not really into the whole userland thing - can it be an apache issue??
> 15,000 records is not huge. =A0It is just barely even medium. =A0Unless y=
ou
> have giant blob or text fields. =A0If you do have a large database with
> DBD::mysql, it is important to know the benefits and drawbacks of
> mysql_use_result.
I know 15000 is supposed to be nada. But 15000 is the magic number
where things tend to slow down.
You must excuse me, I don't normally type English, so I may tend to
write awkwardly.
I will read up on mysql_use_result though. Thanks for the tip. I see
there is much more docmentation to dive into.
Thanks for all the tips and pointers and not least your time!
------------------------------
Date: Thu, 18 Dec 2008 08:58:11 +0100
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: speeding up cgi perl
Message-Id: <kf0kk4pjqgof3m4b2hfn6vus8uqe12g77a@4ax.com>
skeldoy wrote:
>> You should use placeholders instead for security, but that won't affect
>> speed much.
>
>I know. But it is intended to be used by inhouse people, and if they
>mess it up, I will just restore it. :)
Tsk.
It's not hard, and here is how:
>>>select from db where value like "%$query%"
my $sth = $dbh->prepare("select * from db '%' || ? || '%'");
$sth->execute($query);
How hard was that?
--
Bart.
------------------------------
Date: Wed, 17 Dec 2008 21:09:35 -0800 (PST)
From: "freesoft12@gmail.com" <freesoft12@gmail.com>
Subject: Suggestions for distributing my Perl program
Message-Id: <e041dec3-a103-4853-a9b5-c71c1c499b8b@n33g2000pri.googlegroups.com>
Hi,
I want to create a Perl program that contains a script, say run.pl,
(that the user executes) and uses code from supporting modules
(multiple .pm files). These perl files will be installed in any
directory.
I currently have in mind this kind of installation hierarchy:
<install location>/MYTOOL/bin/run.pl
<install location>/MYTOOL/modules/Options.pm
<install location>/MYTOOL/modules/Utils.pm
<install location>/MYTOOL/modules/DB.pm
Questions:
1) How can run.pl import these modules, Options.pm etc?
2) Is there a standard way of installing my program?
Regards
John
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V11 Issue 2063
***************************************