[30982] in Perl-Users-Digest
Perl-Users Digest, Issue: 2227 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Feb 22 03:09:45 2009
Date: Sun, 22 Feb 2009 00:09:10 -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 Sun, 22 Feb 2009 Volume: 11 Number: 2227
Today's topics:
Re: FAQ 7.16 How do I create a static variable? <tim@burlyhost.com>
new CPAN modules on Sun Feb 22 2009 (Randal Schwartz)
New well tested makepp snapshot released <occitan@esperanto.org>
Re: Sorting based on existence of keys <burner+usenet@imf.au.dk>
Re: Sorting based on existence of keys <jurgenex@hotmail.com>
Re: using WWW::Mechanize on activestate <larry@example.invalid>
Re: using WWW::Mechanize on activestate <larry@example.invalid>
Re: using WWW::Mechanize on activestate <tadmc@seesig.invalid>
Re: using WWW::Mechanize on activestate <larry@example.invalid>
Re: using WWW::Mechanize on activestate <larry@example.invalid>
Re: using WWW::Mechanize on activestate <tadmc@seesig.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 21 Feb 2009 09:19:28 -0800
From: Tim Greer <tim@burlyhost.com>
Subject: Re: FAQ 7.16 How do I create a static variable?
Message-Id: <EIWnl.10939$aZ3.6559@newsfe01.iad>
sln@netherlands.com wrote:
> On Sat, 21 Feb 2009 00:03:02 -0800, PerlFAQ Server
> <brian@stonehenge.com> wrote:
>
>>This is an excerpt from the latest version perlfaq7.pod, which
>>comes with the standard Perl distribution. These postings aim to
>>reduce the number of repeated questions as well as allow the community
>>to review and update the answers. The latest version of the complete
>>perlfaq is at http://faq.perl.org .
>>
>>--------------------------------------------------------------------
>>
>>7.16: How do I create a static variable?
>>
>> (contributed by brian d foy)
>>
>> In Perl 5.10,
> [snip]
> Why don't you go live in another dimension, call it the new shit!
> Otherwise you can't, even if its just an acronym.
>
> Why waste peoples' time with bullshit?
>
> Faq workers suck as usual, determined via trial and error !
> Anybody says there is ONE Faq worker is full of shit !!
> If one, he/she sucks beyond compare and if many, they suck
> exponetially !!
>
> -sln
Why don't you knock it off already? There's no reason to get so excited
and upset about it and use profanity. If you bothered to notice, Brian
replied to your complaint about another FAQ article the other day and
stated he had updated the FAQ with the information you posted. These
are FAQs that were compiled from a lot of people's input and
contributions over the years, and all you do is freak out randomly in
response to them being posted as a means to offer help to new users
that could benefit from them. You are clearly welcome to contribute
and they will accept valid contributions and modify the FAQ. So,
exactly what is the big problem you have here about them? I'm also not
responding to your other post, where you (as usual) replied to yourself
with even more abusive and profane nonsense.
--
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: Sun, 22 Feb 2009 05:42:25 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Feb 22 2009
Message-Id: <KFGD6p.1qFG@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.
Acme-CPANAuthors-Taiwanese-0.03
http://search.cpan.org/~gugod/Acme-CPANAuthors-Taiwanese-0.03/
We are Taiwanese CPAN Authors!
----
Acme-Matt-Daemon-0.01
http://search.cpan.org/~rkrimen/Acme-Matt-Daemon-0.01/
MATT DAEMON
----
Algorithm-Evolutionary-0.64_2
http://search.cpan.org/~jmerelo/Algorithm-Evolutionary-0.64_2/
Perl module for performing paradigm-free evolutionary algorithms.
----
Argv-1.24
http://search.cpan.org/~dsb/Argv-1.24/
Provide an OO interface to an arg vector
----
B-Hooks-OP-Annotation-0.32
http://search.cpan.org/~chocolate/B-Hooks-OP-Annotation-0.32/
Annotate and delegate hooked OPs
----
BerkeleyDB-0.38
http://search.cpan.org/~pmqs/BerkeleyDB-0.38/
Perl extension for Berkeley DB version 2, 3 or 4
----
Bundle-DBD-PO-2.03
http://search.cpan.org/~steffenw/Bundle-DBD-PO-2.03/
A bundle to install all DBD::PO related modules
----
C-TCC-0.04
http://search.cpan.org/~hamano/C-TCC-0.04/
An interface to the TCC(Tiny C Compiler)
----
Class-Attribute-0.024_02
http://search.cpan.org/~deepfryed/Class-Attribute-0.024_02/
A fast and light weight alternative for defining class attributes.
----
ClearCase-Argv-1.43
http://search.cpan.org/~dsb/ClearCase-Argv-1.43/
ClearCase-specific subclass of Argv
----
ClearCase-Wrapper-1.15
http://search.cpan.org/~dsb/ClearCase-Wrapper-1.15/
General-purpose wrapper for cleartool
----
DBD-PO-2.03
http://search.cpan.org/~steffenw/DBD-PO-2.03/
DBI driver for PO files
----
Data-Localize-0.00002
http://search.cpan.org/~dmaki/Data-Localize-0.00002/
Alternate Data Localization API
----
Devel-Pragma-0.53
http://search.cpan.org/~chocolate/Devel-Pragma-0.53/
helper functions for developers of lexical pragmas
----
Faster-0.1
http://search.cpan.org/~mlehmann/Faster-0.1/
do some things faster
----
GPS-Garmin-Connect-0.01
http://search.cpan.org/~hpoul/GPS-Garmin-Connect-0.01/
Allows simple fetching of activities from http://connect.garmin.com
----
Getopt-Mixed-Help-0.22
http://search.cpan.org/~dorner/Getopt-Mixed-Help-0.22/
combine Getopt::Mixed with usage and help
----
GlbDNS-0.29
http://search.cpan.org/~abergman/GlbDNS-0.29/
Perl daemon for global load balancing
----
HTML-Tidy-libXML-0.01
http://search.cpan.org/~dankogai/HTML-Tidy-libXML-0.01/
Tidy HTML via XML::LibXML
----
HTML-Tidy-libXML-0.02
http://search.cpan.org/~dankogai/HTML-Tidy-libXML-0.02/
Tidy HTML via XML::LibXML
----
HTTP-Headers-Fast-0.10
http://search.cpan.org/~tokuhirom/HTTP-Headers-Fast-0.10/
faster implementation of HTTP::Headers
----
JSON-2.13
http://search.cpan.org/~makamaka/JSON-2.13/
JSON (JavaScript Object Notation) encoder/decoder
----
Jaipo-0.02
http://search.cpan.org/~cornelius/Jaipo-0.02/
Jaiku (and other micro-blogging sites) Client
----
Method-Lexical-0.20
http://search.cpan.org/~chocolate/Method-Lexical-0.20/
private methods and lexical method overrides
----
MooseX-Declare-0.04
http://search.cpan.org/~flora/MooseX-Declare-0.04/
Declarative syntax for Moose
----
MooseX-Method-Signatures-0.07
http://search.cpan.org/~flora/MooseX-Method-Signatures-0.07/
Method declarations with type constraints and no source filter
----
MooseX-Method-Signatures-0.08
http://search.cpan.org/~flora/MooseX-Method-Signatures-0.08/
Method declarations with type constraints and no source filter
----
Net-Generatus-0.30
http://search.cpan.org/~shiny/Net-Generatus-0.30/
----
Net-Interface-1.001
http://search.cpan.org/~miker/Net-Interface-1.001/
Perl extension to access network interfaces
----
Net-Trac-0.08
http://search.cpan.org/~jesse/Net-Trac-0.08/
Interact with a remote Trac instance
----
Net-Trac-0.09
http://search.cpan.org/~jesse/Net-Trac-0.09/
Interact with a remote Trac instance
----
Number-Phone-CountryCode-0.01
http://search.cpan.org/~mschout/Number-Phone-CountryCode-0.01/
Country phone dialing prefixes
----
POE-Component-Algorithm-Evolutionary-0.2.1
http://search.cpan.org/~jmerelo/POE-Component-Algorithm-Evolutionary-0.2.1/
Run evolutionary algorithms in a preemptive multitasking way.
----
Parse-Method-Signatures-1.002000
http://search.cpan.org/~ash/Parse-Method-Signatures-1.002000/
Perl6 like method signature parser
----
SOAP-WSDL-2.00.07
http://search.cpan.org/~mkutter/SOAP-WSDL-2.00.07/
SOAP with WSDL support
----
Search-Sitemap-2.02
http://search.cpan.org/~jasonk/Search-Sitemap-2.02/
Perl extension for managing Search Engine Sitemaps
----
Search-Sitemap-2.03
http://search.cpan.org/~jasonk/Search-Sitemap-2.03/
Perl extension for managing Search Engine Sitemaps
----
Search-Sitemap-2.04
http://search.cpan.org/~jasonk/Search-Sitemap-2.04/
Perl extension for managing Search Engine Sitemaps
----
Simo-Error-0.01_01
http://search.cpan.org/~kimoto/Simo-Error-0.01_01/
Error object for Simo
----
Simo-Error-0.0201
http://search.cpan.org/~kimoto/Simo-Error-0.0201/
Error object for Simo
----
Simo-Util-0.01_04
http://search.cpan.org/~kimoto/Simo-Util-0.01_04/
Utility Class for Simo
----
Simo-Util-0.0201
http://search.cpan.org/~kimoto/Simo-Util-0.0201/
Utility Class for Simo
----
Simo-Wrapper-0.0201
http://search.cpan.org/~kimoto/Simo-Wrapper-0.0201/
Object wrapper to manipulate attrs and methods.
----
Simo-Wrapper-0.0202
http://search.cpan.org/~kimoto/Simo-Wrapper-0.0202/
Object wrapper to manipulate attrs and methods.
----
TaskForest-1.17
http://search.cpan.org/~enoor/TaskForest-1.17/
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.
----
Template-Plugin-XML-Feed-0.03
http://search.cpan.org/~davecross/Template-Plugin-XML-Feed-0.03/
Plugin interface to XML::Feed
----
Test-LeakTrace-0.01
http://search.cpan.org/~gfuji/Test-LeakTrace-0.01/
Traces memory leaks (EXPERIMENTAL)
----
Test-WWW-Mechanize-HSS-0.01
http://search.cpan.org/~corion/Test-WWW-Mechanize-HSS-0.01/
Test HTTP::Server::Simple programs using WWW::Mechanize
----
Test-XML-Deep-0.03
http://search.cpan.org/~jlavallee/Test-XML-Deep-0.03/
= XML::Simple + Test::Deep
----
Text-Tx-0.02
http://search.cpan.org/~dankogai/Text-Tx-0.02/
Perl interface to Tx by OKANOHARA Daisuke
----
WWW-Hanako-0.03
http://search.cpan.org/~hamano/WWW-Hanako-0.03/
Perl interface for Hanako(Pollen observation system at Japan)
----
YUI-Loader-0.06_1
http://search.cpan.org/~rkrimen/YUI-Loader-0.06_1/
Load (and cache) the Yahoo JavaScript YUI framework
----
YUI-Loader-0.06_2
http://search.cpan.org/~rkrimen/YUI-Loader-0.06_2/
Load (and cache) the Yahoo JavaScript YUI framework
----
jQuery-Loader-0.02_1
http://search.cpan.org/~rkrimen/jQuery-Loader-0.02_1/
Load (and cache) the jQuery JavaScript library
----
makepp-1.50.090221
http://search.cpan.org/~pfeiffer/makepp-1.50.090221/
Compatible but improved replacement for make
----
mysubs-1.02
http://search.cpan.org/~chocolate/mysubs-1.02/
lexical subroutines
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: Sat, 21 Feb 2009 23:36:11 +0100
From: Daniel Pfeiffer <occitan@esperanto.org>
Subject: New well tested makepp snapshot released
Message-Id: <49A081DB.2090707@esperanto.org>
Makepp is a drop-in replacement for GNU make which has a number of
features that allow for reliable builds and simpler build files. It
supports almost all of the syntax that GNU make supports, and can be
used with makefiles produced by utilities such as automake. It is called
makepp (or make++) because originally it was designed for building C++
programs. Also its relationship to make is analogous to C++'s
relationship to C: it is almost 100% backward compatible but adds a
number of new features. But there are much better ways to write makefiles.
Here's again a new well tested beta snapshot. The highlight is being
good citizens: our classes no longer clutter many top level namespaces
and have instead moved to package Mpp (which is the shortcut prefix of
the makepp family of commands, e.g. mppc is an alias to makeppclean.)
Besides there are some bug fixes, most notably symlinks (which are
problematic dependencies, because they stand for two different files)
are finally handled consistently.
Homepage: http://makepp.sourceforge.net/
Documentation: http://makepp.sourceforge.net/1.50/
Download: http://search.cpan.org/~pfeiffer/makepp-1.50.090221/
coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
--
lerne / learn / apprends / lär dig / ucz się Esperanto:
http://lernu.net / http://ikurso.net
------------------------------
Date: Sat, 21 Feb 2009 17:32:59 +0100
From: Rasmus Villemoes <burner+usenet@imf.au.dk>
Subject: Re: Sorting based on existence of keys
Message-Id: <u0l8wnzrbr8.fsf@orc07.imf.au.dk>
Uri Guttman <uri@stemsystems.com> writes:
> >> the point is that you want to do key extraction/processing only one time
> >> both for speed and for clarity.
>
> RV> Yes, that it is what I was trying to achieve. But I would expect that
> RV> the allocation of memory for all these small anonymous arrays would be
> RV> rather time-consuming, also.
>
> nope. you need to learn some algorithm theory before you make that
> claim. the malloc and key extraction stuff is O(N) which increases
> linearly. the actual sort comparisons are O(N log N) which increase much
> faster.
Actually, I _do_ know some algorithm theory, and I also know that in
concrete situations with some upper bound on N an O(N log N) algorithm
may be faster than an O(N) algorithm, because of the unmentioned
constants hidden in the O-notation.
> so for short data sets, your will be faster
Yes, that was what I thought. I didn't write this, but I know that my
data sets will never have more than around 40 elements (most probably
even shorter). But I will need to do this lots of times over, so I'm
interested in using the method which is fastest for short data
sets. Once I get some real data to work with, I will test the
different methods you and others have suggested.
> RV> my @ks = qw(two three one four);
> RV> my %h = ( one => 1,
> RV> three => 333 );
>
> RV> for (sort { (exists $h{$b} && 10-length $h{$b}) <=>
> RV> (exists $h{$a} && 10-length $h{$a}) } @ks) { print "$_\n" }
>
> and you consider that clearer logic and code than the ST version?
No, I didn't say it was clearer. The problem with string lengths is
non-existent in the real case I'm considering, because, as mentioned,
I am really looking at some other properties of $h{$a}.
--
Rasmus Villemoes
<http://rasmusvillemoes.dk/>
------------------------------
Date: Sat, 21 Feb 2009 08:34:22 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Sorting based on existence of keys
Message-Id: <rma0q45a27rlhku87slcc2o7rdego934jj@4ax.com>
Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "EP" == Eric Pozharski <whynot@pozharski.name> writes:
>
> EP> On 2009-02-19, Uri Guttman <uri@stemsystems.com> wrote:
> >>
> JE> $h{$a} and $h{$b} exist ===> length($h{$a}) <=> length($h{$a})
> JE> $h{$a} exists but $h{$b} doesn't ===> -1
> JE> $h{$a} does't exist but $h{$b} does ===> 1
> JE> Neither $h{$a} nor $h{$b} exists ===> 0
> >>
> >> this is why doing a prefilter on the sort keys makes life much
> >> simpler.
[...]
> when you add that back
>you get much more complicated comparisons. i haven't even brought up
>speed for which the presort key extraction is needed. see my other post
>for an example which should work if i typed it cleanly and is simpler,
>clearer and faster.
Different approaches do the same problem.
You are favouring reducing/adjusting the data domain such that you can
use standard Perl operators while I favour adding a new comparison
operator to my data algebra, i.e. I have a given data domain and create
the proper comparison operator for that given domain.
To me my approach is much cleaner and simpler because I don't have to
tweak the data set just to make the comparison work. Also, I am not
convinced that your speed argument is correct, but it's really not
important enough to write a big benchmark test.
To everyone his own, I guess.
jue
------------------------------
Date: Sat, 21 Feb 2009 19:29:03 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: using WWW::Mechanize on activestate
Message-Id: <1ult6qu855krz$.1r8qqt09mdsj7.dlg@40tude.net>
On Sat, 21 Feb 2009 16:54:22 +0100, Marc Lucksch wrote:
> Peter Scott schrieb:
>> I've used ppm to install Mech on a modern Windows perl, so I know it's
>> doable.
>
> You could also try
>
> perl -MCPAN -e install -e WWW::Mechanize
>
> worked fine for me and didn't need to compile anything
Thanks all for responses. I could have been more forthcoming in my last
post. With the additional ppm install of what looked closest to this:
Can't locate HTTP/Response/Encoding.pm in @INC (@INC contains:
, I get output for this script. Am I correct to believe that all I need to
do to get a similar error is use another method that is in a dependency of
WWW::Mechanize which I don't have?
Anyways, I'm curious what others' AS install looks like with a "sucessful"
WWW::Mechanize install. This is what mine looks like:
C:\Perl\site\lib>dir
Volume in drive C has no label.
Volume Serial Number is 942A-AD55
Directory of C:\Perl\site\lib
02/21/2009 03:15 AM <DIR> .
02/21/2009 03:15 AM <DIR> ..
02/13/2009 01:09 AM <DIR> Acme
02/21/2009 03:15 AM <DIR> auto
02/20/2009 05:59 PM <DIR> Bundle
02/20/2009 05:59 PM <DIR> Data
01/30/2009 10:06 PM <DIR> DateTime
12/29/2008 10:39 PM <DIR> HTML
02/21/2009 03:15 AM <DIR> HTTP
02/13/2009 01:15 AM 1,425 perl4.lnk
01/23/2007 04:15 PM 31 sitecustomize.pl
02/20/2009 06:14 PM <DIR> WWW
2 File(s) 1,456 bytes
10 Dir(s) 66,206,498,816 bytes free
C:\Perl\site\lib>cd WWW
C:\Perl\site\lib\WWW>dir
Volume in drive C has no label.
Volume Serial Number is 942A-AD55
Directory of C:\Perl\site\lib\WWW
02/20/2009 06:14 PM <DIR> .
02/20/2009 06:14 PM <DIR> ..
02/20/2009 06:15 PM <DIR> Mechanize
01/11/2009 11:40 PM 76,615 Mechanize.pm
1 File(s) 76,615 bytes
3 Dir(s) 66,206,498,816 bytes free
C:\Perl\site\lib\WWW>cd Mechanize
C:\Perl\site\lib\WWW\Mechanize>dir
Volume in drive C has no label.
Volume Serial Number is 942A-AD55
Directory of C:\Perl\site\lib\WWW\Mechanize
02/20/2009 06:15 PM <DIR> .
02/20/2009 06:15 PM <DIR> ..
01/11/2009 11:33 PM 2,208 Cookbook.pod
01/11/2009 11:33 PM 15,834 Examples.pod
01/11/2009 11:33 PM 14,515 FAQ.pod
02/20/2009 05:59 PM <DIR> FormFiller
02/20/2009 05:59 PM 13,578 FormFiller.pm
01/11/2009 11:33 PM 2,317 Image.pm
01/11/2009 11:33 PM 2,189 Link.pm
02/20/2009 06:15 PM <DIR> Mechanize
01/11/2009 11:40 PM 76,615 Mechanize.pm
7 File(s) 127,256 bytes
4 Dir(s) 66,206,498,816 bytes free
C:\Perl\site\lib\WWW\Mechanize>cd Mechanize
C:\Perl\site\lib\WWW\Mechanize\Mechanize>dir
Volume in drive C has no label.
Volume Serial Number is 942A-AD55
Directory of C:\Perl\site\lib\WWW\Mechanize\Mechanize
02/20/2009 06:15 PM <DIR> .
02/20/2009 06:15 PM <DIR> ..
01/11/2009 11:33 PM 2,208 Cookbook.pod
01/11/2009 11:33 PM 15,834 Examples.pod
01/11/2009 11:33 PM 14,515 FAQ.pod
01/11/2009 11:33 PM 2,317 Image.pm
01/11/2009 11:33 PM 2,189 Link.pm
5 File(s) 37,063 bytes
2 Dir(s) 66,206,498,816 bytes free
C:\Perl\site\lib\WWW\Mechanize\Mechanize>cd ..
C:\Perl\site\lib\WWW\Mechanize>cd Formfiller
C:\Perl\site\lib\WWW\Mechanize\FormFiller>dir
Volume in drive C has no label.
Volume Serial Number is 942A-AD55
Directory of C:\Perl\site\lib\WWW\Mechanize\FormFiller
02/20/2009 05:59 PM <DIR> .
02/20/2009 05:59 PM <DIR> ..
02/20/2009 05:59 PM <DIR> Value
02/20/2009 05:59 PM 1,623 Value.pm
1 File(s) 1,623 bytes
3 Dir(s) 66,206,498,816 bytes free
C:\Perl\site\lib\WWW\Mechanize\FormFiller>cd ..
C:\Perl\site\lib\WWW\Mechanize>cd ..
C:\Perl\site\lib\WWW>cd ..
C:\Perl\site\lib>cd HTML
C:\Perl\site\lib\HTML>dir
Volume in drive C has no label.
Volume Serial Number is 942A-AD55
Directory of C:\Perl\site\lib\HTML
12/29/2008 10:39 PM <DIR> .
12/29/2008 10:39 PM <DIR> ..
12/29/2008 10:39 PM 15,060 Entities.pm
12/29/2008 10:39 PM 2,685 Filter.pm
12/29/2008 10:39 PM 6,937 HeadParser.pm
12/29/2008 10:39 PM 4,479 LinkExtor.pm
12/29/2008 10:39 PM 39,755 Parser.pm
12/29/2008 10:39 PM 5,681 PullParser.pm
12/29/2008 10:39 PM 10,023 TokeParser.pm
7 File(s) 84,620 bytes
2 Dir(s) 66,206,498,816 bytes free
C:\Perl\site\lib\HTML>
Doesn't it look wrong to have 2 Mechanize folders in the lib?
--
larry gates
Well, enough clowning around. Perl is, in intent, a cleaned up and
summarized version of that wonderful semi-natural language known as
"Unix".
-- Larry Wall in <1994Apr6.184419.3687@netlabs.com>
------------------------------
Date: Sat, 21 Feb 2009 19:42:35 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: using WWW::Mechanize on activestate
Message-Id: <1x28h0hjnzmbt$.1hheq3jm83gdp$.dlg@40tude.net>
On Fri, 20 Feb 2009 19:54:34 -0600, Tad J McClellan wrote:
> Larry Gates <larry@example.invalid> wrote:
>>
>> I've been trying to get scrape the web page that is given in the faqs as a
>> searching resource and then automate the page. WWW::Mechanize is not one
>> of the modules that activestate bundles, so I needed it off the web.
>>
>> I think activestate made a less-than-effective install, as when I was done
>> with it, it didn't have a Mechanize.pm in it anywhere. So I download
>> Mechanize.pm from cpan and put it in the WWW folder.
>
>
> What does "the WWW folder" mean when you say it?
If it's not "world wide web," then it's the triune George, or a demotion of
XXX.
>
>
>> Now my error is:
>>
>> C:\MinGW\source> perl goog2.pl
>> Can't locate HTTP/Response/Encoding.pm in @INC (@INC contains:
>> C:/Perl/site/lib
>> C:/Perl/lib .) at C:/Perl/site/lib/WWW/Mechanize.pm line 109.
>> BEGIN failed--compilation aborted at C:/Perl/site/lib/WWW/Mechanize.pm line
>> 109.
>>
>> Compilation failed in require at goog2.pl line 9.
>> BEGIN failed--compilation aborted at goog2.pl line 9.
>>
>> C:\MinGW\source>
>>
>> What is this telling me?
>
>
> All of the messages that perl might issue are documented in:
>
> perldoc perldiag
>
> Did you look up the message there?
>
> If you put
>
> use diagnostics;
>
> near the beginning of your program and run it again,
> then perl will look up the message and display its docs for you...
I've added that to the script now. I don't think I'm done making mistakes
with this for the foreseeable future, so I'll peck away at it. I thought
this has an interesting taxonomy:
(W) A warning (optional).
(D) A deprecation (optional).
(S) A severe warning (default).
(F) A fatal error (trappable).
(P) An internal error you should never see (trappable).
(X) A very fatal error (nontrappable).
(A) An alien error message (not generated by Perl).
>
>
> It is telling you that WWW::Mechanize depends on ("use"s) HTTP::Response.
>
> When you install a module, you also need to install all of its
> dependencies, and all of the dependencies of the dependencies, and ...
Why is there no Response.pm in my HTTP folder?
--
larry gates
It won't be covered in the book. The source code has to be useful for
something, after all... :-)
-- Larry Wall in <10160@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: Sat, 21 Feb 2009 20:41:03 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: using WWW::Mechanize on activestate
Message-Id: <slrngq1epv.sg6.tadmc@tadmc30.sbcglobal.net>
Larry Gates <larry@example.invalid> wrote:
> On Fri, 20 Feb 2009 19:54:34 -0600, Tad J McClellan wrote:
>
>> Larry Gates <larry@example.invalid> wrote:
>>>
>>> I've been trying to get scrape the web page that is given in the faqs as a
>>> searching resource and then automate the page. WWW::Mechanize is not one
>>> of the modules that activestate bundles, so I needed it off the web.
>>>
>>> I think activestate made a less-than-effective install, as when I was done
>>> with it, it didn't have a Mechanize.pm in it anywhere. So I download
>>> Mechanize.pm from cpan and put it in the WWW folder.
>>
>>
>> What does "the WWW folder" mean when you say it?
>
> If it's not "world wide web," then it's the triune George, or a demotion of
> XXX.
If you're just joking around, I can stop reading your posts.
It was not a rhetorical question, I thought the answer might
help me to help you.
Good luck.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 21 Feb 2009 19:50:21 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: using WWW::Mechanize on activestate
Message-Id: <1jv97y7rqloes$.1kgoyece7xsf0$.dlg@40tude.net>
On Fri, 20 Feb 2009 20:08:58 -0800, Tim Greer wrote:
> Seems to indicate it can't locate the Encoding module. Instead of just
> dropping a module file into a directory, try installing the module
> normally via CPAN or with the module's source/build steps (and ensure
> you install any requirements for that module). This way you don't risk
> having partial installs. The error you saw seems to specifically
> outline the problem.
Thanks for your reply, Tim.
#!/usr/bin/perl
# url http://groups.google.com/advanced_search
use warnings;
use strict;
use diagnostics;
use HTML::TreeBuilder;
use LWP::Simple;
use LWP::UserAgent;
use WWW::Mechanize;
my $site_url = 'http://groups.google.com';
my $url_args = 'advanced_search';
my $t = get "$site_url/$url_args" || "Problem";
my $tree = HTML::TreeBuilder->new_from_content($t);
$tree->dump;
my $g = 'comp.lang.perl.misc';
my $s = 'mechanize website';
# perl goog3.pl
You've helped me chase down one of these tags before, getting values in
entities similar to the following:
foreach my $elem ( $tree2->look_down('_tag', 'center') ) {
++ $i;
print "i is $i\n";
print "elem is $elem\n";
print $elem->as_text(), "\n";
}
foreach my $elem ( $tree2->find_by_attribute('name', 'lat') ) {
print "****";
print $elem->attr('value'), "\n";
}
The fields I want to populate are:
<input name="as_ugroup" size="40" type="text" value="" />
<input name="as_usubject" size="40"
I want to put $g into the group and $s in the subject.
Fishing for tips.
--
larry gates
echo "Congratulations. You aren't running Eunice."
-- Larry Wall in Configure from the perl distribution
------------------------------
Date: Sat, 21 Feb 2009 19:54:45 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: using WWW::Mechanize on activestate
Message-Id: <1ub4k8dcumgxu$.1v25k56ue3972$.dlg@40tude.net>
On Sat, 21 Feb 2009 20:41:03 -0600, Tad J McClellan wrote:
> Larry Gates <larry@example.invalid> wrote:
>> On Fri, 20 Feb 2009 19:54:34 -0600, Tad J McClellan wrote:
>>
>>> Larry Gates <larry@example.invalid> wrote:
>>>>
>>>> I've been trying to get scrape the web page that is given in the faqs as a
>>>> searching resource and then automate the page. WWW::Mechanize is not one
>>>> of the modules that activestate bundles, so I needed it off the web.
>>>>
>>>> I think activestate made a less-than-effective install, as when I was done
>>>> with it, it didn't have a Mechanize.pm in it anywhere. So I download
>>>> Mechanize.pm from cpan and put it in the WWW folder.
>>>
>>>
>>> What does "the WWW folder" mean when you say it?
>>
>> If it's not "world wide web," then it's the triune George, or a demotion of
>> XXX.
>
>
> If you're just joking around, I can stop reading your posts.
>
> It was not a rhetorical question, I thought the answer might
> help me to help you.
>
> Good luck.
That part of the response was a joke. I thought triune George and demotion
of XXX were funny alternatives.
I value your comment and attention to detail when you communicate.
Tenacity of purpose is another name for good luck.
--
larry gates
Wheelbarrow is a scavenger. That is to say, he's a sysadmin.
-- Larry Wall in The State of the Onion 9
------------------------------
Date: Sat, 21 Feb 2009 23:55:46 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: using WWW::Mechanize on activestate
Message-Id: <slrngq1q72.tel.tadmc@tadmc30.sbcglobal.net>
Larry Gates <larry@example.invalid> wrote:
> use WWW::Mechanize;
> The fields I want to populate are:
><input name="as_ugroup" size="40" type="text" value="" />
>
><input name="as_usubject" size="40"
>
> I want to put $g into the group and $s in the subject.
>
> Fishing for tips.
Expecting us to write your programs for you is going to be disappointing.
Read the documentation for the module you plan to use:
perldoc WWW::Mechanize
...
$mech->submit_form(
form_number => 3,
fields => {
username => 'mungo',
password => 'lost-and-alone',
}
);
Find out how to identify which form on the page to submit, set form_number
to the correct value, or use one of the other Mechanize methods for
identifying the form that you want to submit.
Replace the "username" and "password" fields in the
example code with "as_ugroup" and "as_usubject".
However, what you appear to be doing violates Google's ToS:
http://groups.google.com/intl/en/googlegroups/terms_of_service3.html
you agree that when using the Service, you will not:
...
use any robot, spider, site search/retrieval application, or other
device to retrieve or index any portion of the Service or collect
information about users for any unauthorized purpose;
So pick some other website that allows you to do what you
are attempting to do.
--
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 2227
***************************************