[30968] in Perl-Users-Digest
Perl-Users Digest, Issue: 2213 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 16 14:14:24 2009
Date: Mon, 16 Feb 2009 11:14:15 -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 Mon, 16 Feb 2009 Volume: 11 Number: 2213
Today's topics:
new CPAN modules on Mon Feb 16 2009 (Randal Schwartz)
Re: question on de-referencing expressions <bmb@mail.libs.uga.edu>
Re: Regexp discovery - using ^ with /m is a time sink <koszalekopalek@interia.pl>
Re: Regexp discovery - using ^ with /m is a time sink <koszalekopalek@interia.pl>
Re: time and place of satellite coincidence <hjp-usenet2@hjp.at>
Re: time and place of satellite coincidence <tadmc@seesig.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 16 Feb 2009 05:42:32 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Feb 16 2009
Message-Id: <KF596w.x2p@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.
AnyEvent-XMPP-0.4
http://search.cpan.org/~elmex/AnyEvent-XMPP-0.4/
An implementation of the XMPP Protocol
----
App-Benchmark-Accessors-0.05
http://search.cpan.org/~marcel/App-Benchmark-Accessors-0.05/
Benchmark accessor generators
----
App-CPAN2Pkg-0.4.1
http://search.cpan.org/~jquelin/App-CPAN2Pkg-0.4.1/
generating native linux packages from cpan
----
App-Maisha-0.04
http://search.cpan.org/~barbie/App-Maisha-0.04/
A command line social micro-blog networking tool.
----
B-Hooks-OP-Annotation-0.31
http://search.cpan.org/~chocolate/B-Hooks-OP-Annotation-0.31/
Annotate and delegate hooked OPs
----
Big5Plus-0.33
http://search.cpan.org/~ina/Big5Plus-0.33/
"Yet Another JPerl" Source code filter to escape Big5Plus
----
CPAN-Mini-ProjectDocs-0.03.9
http://search.cpan.org/~nkh/CPAN-Mini-ProjectDocs-0.03.9/
mini CPAN documentation browser
----
CPAN-Testers-Data-Uploads-0.05
http://search.cpan.org/~barbie/CPAN-Testers-Data-Uploads-0.05/
CPAN Testers Uploads Database Generator
----
CPAN-Testers-Data-Uploads-0.06
http://search.cpan.org/~barbie/CPAN-Testers-Data-Uploads-0.06/
CPAN Testers Uploads Database Generator
----
CPAN-WWW-Top100-Generator-0.01
http://search.cpan.org/~adamk/CPAN-WWW-Top100-Generator-0.01/
Create or update the website for http://ali.as/top100
----
CPAN-WWW-Top100-Generator-0.02
http://search.cpan.org/~adamk/CPAN-WWW-Top100-Generator-0.02/
Create or update the website for http://ali.as/top100
----
CPANTS-Weight-0.01
http://search.cpan.org/~adamk/CPANTS-Weight-0.01/
Graph based weights for CPAN Distributions
----
CPANTS-Weight-0.02
http://search.cpan.org/~adamk/CPANTS-Weight-0.02/
Graph based weights for CPAN Distributions
----
Class-Axelerator-0.02
http://search.cpan.org/~dankogai/Class-Axelerator-0.02/
Evade OO taxes
----
Class-MethodMaker-2.15
http://search.cpan.org/~schwigon/Class-MethodMaker-2.15/
Create generic methods for OO Perl
----
Class-Sniff-0.07
http://search.cpan.org/~ovid/Class-Sniff-0.07/
Look for class composition code smells
----
Class-Sniff-0.08
http://search.cpan.org/~ovid/Class-Sniff-0.08/
Look for class composition code smells
----
Collection-0.42
http://search.cpan.org/~zag/Collection-0.42/
Collections framework for CRUD of the data or objects.
----
Data-Localize-0.00001_01
http://search.cpan.org/~dmaki/Data-Localize-0.00001_01/
Alternate Data Localization API
----
DateTime-Format-Natural-0.74_04
http://search.cpan.org/~schubiger/DateTime-Format-Natural-0.74_04/
Create machine readable date/time with natural parsing logic
----
Devel-NYTProf-2.08
http://search.cpan.org/~timb/Devel-NYTProf-2.08/
Powerful feature-rich perl source code profiler
----
Devel-REPL-1.003004
http://search.cpan.org/~oliver/Devel-REPL-1.003004/
a modern perl interactive shell
----
Encode-2.30
http://search.cpan.org/~dankogai/Encode-2.30/
character encodings
----
FFmpeg-Command-0.08
http://search.cpan.org/~mizzy/FFmpeg-Command-0.08/
A wrapper class for ffmpeg command line utility.
----
File-Copy-Vigilant-1.01
http://search.cpan.org/~kilna/File-Copy-Vigilant-1.01/
Copy and move files with verification and retries
----
GBK-0.33
http://search.cpan.org/~ina/GBK-0.33/
"Yet Another JPerl" Source code filter to escape GBK
----
Git-CPAN-Patch-0.1.4
http://search.cpan.org/~yanick/Git-CPAN-Patch-0.1.4/
Patch CPAN modules using Git
----
HTML-Packer-0.4
http://search.cpan.org/~nevesenin/HTML-Packer-0.4/
Another HTML code cleaner
----
HTTP-Engine-Middleware-0.04
http://search.cpan.org/~yappo/HTTP-Engine-Middleware-0.04/
middlewares distribution
----
HeliosX-ExtLoggerService-0.02_0771
http://search.cpan.org/~lajandy/HeliosX-ExtLoggerService-0.02_0771/
Helios::Service class to allow Helios logging to external logging systems
----
HeliosX-Logger-Log4perl-0.02_0771
http://search.cpan.org/~lajandy/HeliosX-Logger-Log4perl-0.02_0771/
HeliosX::Logger subclass implementing logging to Log4perl for Helios
----
HeliosX-Logger-Syslog-0.02_0771
http://search.cpan.org/~lajandy/HeliosX-Logger-Syslog-0.02_0771/
HeliosX::Logger subclass implementing logging to syslogd for Helios
----
HeliosX-MetajobService-0.02_0771
http://search.cpan.org/~lajandy/HeliosX-MetajobService-0.02_0771/
Alternative Helios::Service class to provide simple map/reduce operations
----
IPC-MMA-0.51
http://search.cpan.org/~mackenna/IPC-MMA-0.51/
Shared Memory using Ralf Engelschall's mm library
----
Image-Heatmap-0.4
http://search.cpan.org/~wazzuteke/Image-Heatmap-0.4/
Build heatmap images
----
Lingua-Jspell-1.61
http://search.cpan.org/~ambs/Lingua-Jspell-1.61/
Perl interface to the Jspell morphological analyser.
----
Method-Lexical-0.02
http://search.cpan.org/~chocolate/Method-Lexical-0.02/
private methods and lexical method overrides
----
Mojo-0.9001
http://search.cpan.org/~sri/Mojo-0.9001/
The Web In A Box!
----
Net-NAT-PMP-0.9.3
http://search.cpan.org/~david/Net-NAT-PMP-0.9.3/
Poke holes in a router's NAT using the NAT-PMP protocol
----
Net-SloppyXMPP-0.03
http://search.cpan.org/~wilsond/Net-SloppyXMPP-0.03/
A rather sloppy XMPP client implementation
----
ORDB-CPANTS-0.03
http://search.cpan.org/~adamk/ORDB-CPANTS-0.03/
An ORM for the published CPANTS SQLite database
----
ORLite-1.20
http://search.cpan.org/~adamk/ORLite-1.20/
Extremely light weight SQLite-specific ORM
----
ORLite-Migrate-0.02
http://search.cpan.org/~adamk/ORLite-Migrate-0.02/
Extremely light weight SQLite-specific schema migration
----
Params-Classify-0.006
http://search.cpan.org/~zefram/Params-Classify-0.006/
argument type classification
----
Parse-Eyapp-1.139
http://search.cpan.org/~casiano/Parse-Eyapp-1.139/
Extensions for Parse::Yapp
----
Railsish-0.10
http://search.cpan.org/~gugod/Railsish-0.10/
A web application framework.
----
Sjis-0.33
http://search.cpan.org/~ina/Sjis-0.33/
"Yet Another JPerl" Source code filter to escape ShiftJIS
----
Sniffer-HTTP-0.19
http://search.cpan.org/~corion/Sniffer-HTTP-0.19/
multi-connection sniffer driver
----
TaskForest-1.15
http://search.cpan.org/~enoor/TaskForest-1.15/
A simple but expressive job scheduler that allows you to chain jobs/tasks and create time dependencies. Uses text config files to specify task dependencies.
----
Transform-Canvas-0.15
http://search.cpan.org/~ronan/Transform-Canvas-0.15/
Perl extension for performing Coordinate transformation operations from the cartesion to the traditional drawing-model canvas coordinate systems.
----
UHC-0.33
http://search.cpan.org/~ina/UHC-0.33/
"Yet Another JPerl" Source code filter to escape UHC
----
WWW-Freshmeat-0.11
http://search.cpan.org/~chorny/WWW-Freshmeat-0.11/
automates searches on Freshmeat.net
----
Xacobeo-0.07_01
http://search.cpan.org/~potyl/Xacobeo-0.07_01/
XPath (XML Path Language) visualizer.
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: Mon, 16 Feb 2009 12:02:29 -0500
From: Brad Baxter <bmb@mail.libs.uga.edu>
Subject: Re: question on de-referencing expressions
Message-Id: <RRgml.4633$i9.4612@bignews7.bellsouth.net>
olingaa@gmail.com wrote:
> Is there a way do this with one assignment so that the $hash_ref
> variable is not necessary?
>
> my $hash_ref = functionReturningReference();
> my %hash = %$hash_ref;
my %hash = map defined && %$_, func();
__
Brad
------------------------------
Date: Mon, 16 Feb 2009 09:34:43 -0800 (PST)
From: Koszalek Opalek <koszalekopalek@interia.pl>
Subject: Re: Regexp discovery - using ^ with /m is a time sink
Message-Id: <69e2d958-01e8-4bdf-93ac-b5db74372b9a@d32g2000yqe.googlegroups.com>
On Feb 15, 2:20=A0pm, Ilya Zakharevich <nospam-ab...@ilyaz.org> wrote:
> I also found it by benchmarking. =A0Had no time to look into the
> sources...
Should I report this to perlbug@perl.org ?
K.
------------------------------
Date: Mon, 16 Feb 2009 09:54:56 -0800 (PST)
From: Koszalek Opalek <koszalekopalek@interia.pl>
Subject: Re: Regexp discovery - using ^ with /m is a time sink
Message-Id: <7f744567-602c-40d1-afd6-92215d385932@33g2000yqm.googlegroups.com>
On Feb 16, 1:03=A0am, Eric Pozharski <why...@pozharski.name> wrote:
> Once you use random patterns you'll get random
> results -- if your results are random then no-one (you -- first) can't
> trust those results.
The test result is the time ratio (regexp1/regexp2).
You can hardly call it random:
http://en.wikipedia.org/wiki/Law_of_large_numbers
> I've tried your REs -- and for me successful look-behind is slightly
> faster than anything else. =A0(I should admit I've never used C<m//gism>,
> and C<qr/\G/> so that's possible I've messed something up.)
Have you tried just REs or have you run the code that
I posted? I used 5.8.8 for the benchmark but I'm pretty
sure I would have noticed if it ran any faster in 5.10.
Anyway, I'm compiling 5.10 (with the -DDEBUGGING) that
you mentioned elsethread and will try to investigate
further.
K.
------------------------------
Date: Mon, 16 Feb 2009 10:11:53 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: time and place of satellite coincidence
Message-Id: <slrngpibep.4o3.hjp-usenet2@hrunkner.hjp.at>
On 2009-02-16 04:54, Larry Gates <larry@example.invalid> wrote:
> C:\MinGW\source> perl index6.pl
> Global symbol "$tag" requires explicit package name at index6.pl line 30.
> Global symbol "$tag" requires explicit package name at index6.pl line 31.
> Global symbol "$tag" requires explicit package name at index6.pl line 32.
> Global symbol "$tag" requires explicit package name at index6.pl line 33.
> Global symbol "$links_r" requires explicit package name at index6.pl line
> 35.
> Global symbol "$links_r" requires explicit package name at index6.pl line
> 36.
> Execution of index6.pl aborted due to compilation errors.
>
> C:\MinGW\source>
>
> Outside of basically not knowing my I failed here,
You forgot to declare the variables "$tag" and "$links_r".
> I have 2 other
> questions.
>
> q1) I didn't see look_down as a method in HTML::TreeBuilder, HTML::Element
Strange. I see it in HTML::Element (in section "Secondary Structural
Methods", near line 800 when formatted for 80 chars/line).
> and one other HTML::Something that I looked for it. Where do I find a
> definition of the look_down method?
It doesn't seem to be the problem here, but in general:
One of the primary techniques in object-oriented programming is
inheritance. If class X is a subclass of class Y and class Y is a
subclass of class Z, then X inherits all methods from Y and Z. Typically
these methods are documented only once (in Y or Z - wherever they are
defined), so for a complete documentation of X, you need to read all
three perldocs. The documentation of X should mention that X is a
subclass of Y and the documentation of Y should mention that Y is a
subclass of Z, but sometimes that hint is missing or well hidden.
> q2) I *still* have problems with control structures in perl. Why does
> this not print the index variable for the loop?
>
[...]
> foreach my $elem ( $tree->look_down('_tag', 'center') ) {
>
> print "%%\n", $elem;
> print $elem->as_text(), "\n";
> }
There is no "index variable" in this example. There is the "loop variable"
$elem, but it isn't an index in any sense of the word.
If you mean $elem, that is printed just fine. Why do you think it isn't?
Or in other words:
* What did you expect the output to be?
* What was the real output?
hp
------------------------------
Date: Mon, 16 Feb 2009 07:40:25 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: time and place of satellite coincidence
Message-Id: <slrngpir69.a98.tadmc@tadmc30.sbcglobal.net>
Larry Gates <larry@example.invalid> wrote:
> use strict;
Here you have made a promise that you will declare all variables
before you use them.
If you break your promise, perl will refuse to run your program.
[ snip 15 lines of code ]
> use HTML::Element;
"use" is a compile-time statement, so this executes *before*
the 15 (run-time) lines that come before it.
It will work here, but it can be confusing to have lines that
are evaluated early appear late in the code...
> $tag = $a->tag;
> $links_r = $a->extract_links();
You have broken your promise by not declaring these 2 variables.
> Outside of basically not knowing my I failed here, I have 2 other
^^
^^ a fortuitous freudian slip here
> questions.
Put "my " before $tags and $links_r so as to keep your promise.
> q1) I didn't see look_down as a method in HTML::TreeBuilder, HTML::Element
> and one other HTML::Something that I looked for it. Where do I find a
> definition of the look_down method?
I dunno what's going on here.
I see it in the docs for HTML::Element just fine.
> q2) I *still* have problems with control structures in perl. Why does
> this not print the index variable for the loop?
^^^^^^^^^^^^^^
> foreach my $elem ( $tree->look_down('_tag', 'center') ) {
>
> print "%%\n", $elem;
> print $elem->as_text(), "\n";
> }
perldoc perlsyn
Foreach Loops
The C<foreach> loop iterates over a normal list value and sets the
variable VAR to be each element of the list in turn.
$elem is "each element of the list",
not "the index of each element in the list"
With foreach, the programmer does not need to (or have access to) know
any indexes, perl does the indexing for you automatically and simply
returns the indexed *values*.
So, $elem is an HTML::Element object. Your loop is printing the
stringified object (HTML::Element=HASH...) just fine.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
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 2213
***************************************