[31017] in Perl-Users-Digest
Perl-Users Digest, Issue: 2262 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 9 09:09:48 2009
Date: Mon, 9 Mar 2009 06:09:08 -0700 (PDT)
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, 9 Mar 2009 Volume: 11 Number: 2262
Today's topics:
Re: Ban Xah Lee <kentilton@gmail.com>
Re: Ban Xah Lee <sjsobol@JustThe.net>
Re: Ban Xah Lee <tim@burlyhost.com>
Re: Ban Xah Lee <larry@example.invalid>
Re: Ban Xah Lee <larry@example.invalid>
Re: Ban Xah Lee <RedGrittyBrick@spamweary.invalid>
Re: calculate an average with every data in an array <jogsalot75@yahoo.de>
Re: FAQ 9.8 How do I fetch an HTML file? <larry@example.invalid>
Re: FAQ 9.8 How do I fetch an HTML file? <tadmc@seesig.invalid>
new CPAN modules on Mon Mar 9 2009 (Randal Schwartz)
Re: perl as email client <larry@example.invalid>
Re: perl as email client <larry@example.invalid>
Re: perl as email client <larry@example.invalid>
Re: perl as email client <tadmc@seesig.invalid>
Re: What-if algorithm <gamo@telecable.es>
Re: Why Perl 5.10.0 is still considered stable? <tim@burlyhost.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 08 Mar 2009 23:06:50 -0400
From: Kenneth Tilton <kentilton@gmail.com>
To: Roedy Green <see_website@mindprod.com.invalid>
Subject: Re: Ban Xah Lee
Message-Id: <49B487CA.8070202@gmail.com>
Roedy Green wrote:
> On Sat, 7 Mar 2009 14:52:02 -0800 (PST), Xah Lee <xahlee@gmail.com>
> wrote, quoted or indirectly quoted someone who said :
>
>> I consider this post relevant because i've been perennially gossiped
>> about in comp.lang.* groups today and in the past 5 or 10 years, many
>> of the threads mentioning my name are not started by me nor did i ever
>> participate.
>
> The reason you are unpopular has nothing to with what you say. It is
> that you don't participate in discussions. You just pontificate from
> on high. It implies a sort of haughty superciliousness that people are
> reacting to.
Buddha taught that the universe is ineluctably a single interconnected
web of cause and effect, which is my haughty preamble to this
observation: it depends on the newsgroup.
comp.lang.lisp is cool so here Xah participates as a normal contributor.
kt
ps. The "Failed Attempt At Witty Comeback" lines are now open. Plz dial
carefully. k
------------------------------
Date: Mon, 9 Mar 2009 03:19:19 +0000 (UTC)
From: Steve Sobol <sjsobol@JustThe.net>
Subject: Re: Ban Xah Lee
Message-Id: <slrngr92ku.8ur.sjsobol@amethyst.justthe.net>
On 2009-03-09, Kenneth Tilton <kentilton@gmail.com> wrote:
> Buddha taught that the universe is ineluctably a single interconnected
> web of cause and effect, which is my haughty preamble to this
> observation: it depends on the newsgroup.
>
> comp.lang.lisp is cool so here Xah participates as a normal contributor.
That's great, but he trolls like crazy here (comp.lang.java.programmer).
--
Steve Sobol, Victorville, California, USA
Microsoft's new marketing slogan for Windows is "Life Without Walls."
But if you have no walls, how can you have windows?
------------------------------
Date: Sun, 08 Mar 2009 21:09:30 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Ban Xah Lee
Message-Id: <_D0tl.61625$aZ3.56747@newsfe01.iad>
Steve Sobol wrote:
>
> On 2009-03-09, Kenneth Tilton <kentilton@gmail.com> wrote:
>
>> Buddha taught that the universe is ineluctably a single
>> interconnected web of cause and effect, which is my haughty preamble
>> to this observation: it depends on the newsgroup.
>>
>> comp.lang.lisp is cool so here Xah participates as a normal
>> contributor.
>
> That's great, but he trolls like crazy here
> (comp.lang.java.programmer).
>
>
>
Hi hits us at comp.lang.perl.misc and comp.lang.python, too (with off
topic posts). He's just a weirdo that thinks he's incredibly important
and interesting, and just ignores people's requests for him to stop
cross posting. In the end, I've seen worse posters than Xah Lee, but
he's in my killfile.
--
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: Mon, 9 Mar 2009 03:21:03 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: Ban Xah Lee
Message-Id: <1xl539xihylnz.cjkptar74ys4$.dlg@40tude.net>
On Mon, 9 Mar 2009 03:19:19 +0000 (UTC), Steve Sobol wrote:
> On 2009-03-09, Kenneth Tilton <kentilton@gmail.com> wrote:
>
>> Buddha taught that the universe is ineluctably a single interconnected
>> web of cause and effect, which is my haughty preamble to this
>> observation: it depends on the newsgroup.
>>
>> comp.lang.lisp is cool so here Xah participates as a normal contributor.
>
> That's great, but he trolls like crazy here (comp.lang.java.programmer).
I've seen his posts for years now and in different places.
I'm certain he's the smartest computer guy on his street. He takes these
data to show how he's so influential on the net.
I looked at his site once. I wouldn't be convinced that he knows any of
the syntaxes where he posts; then again, I don't know lisp.
I think we all have a definite opinion on massive crossposting with nothing
relevant.
I'm happy to hear that c.l.lisp is a cool place. How's that for five eyes?
--
larry gates
Perl will always provide the null.
-- Larry Wall in <199801151818.KAA14538@wall.org>
------------------------------
Date: Mon, 9 Mar 2009 04:12:06 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: Ban Xah Lee
Message-Id: <1tnvd8x30a82x$.1feiayncvwiwi$.dlg@40tude.net>
On Sun, 08 Mar 2009 04:09:52 +0000, Dirk Bruere at NeoPax wrote:
> Dirk Bruere at NeoPax wrote:
>> Well, don't worry - nobody is going to ban you from Usenet (except
>> possibly the Chinese govt).
>> OTOH, nobody here much cares.
>> So, rant on - it's what Usenet is for. ☄ <--- what is that char?????
http://lomas-assault.net/usenet/z12.jpg
I don't know how to answer the question. Is the zeroeth character also
null?
--
larry gates
You have the irritating habit of asking good questions I don't have
an easy answer for. Please don't stop.
-- Larry Wall in <20050314165932.GA12577@wall.org>
------------------------------
Date: Mon, 09 Mar 2009 11:02:30 +0000
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: Ban Xah Lee
Message-Id: <49b4f749$0$2522$da0feed9@news.zen.co.uk>
Larry Gates wrote:
> On Sun, 08 Mar 2009 04:09:52 +0000, Dirk Bruere at NeoPax wrote:
>
>> Dirk Bruere at NeoPax wrote:
>
>>> Well, don't worry - nobody is going to ban you from Usenet (except
>>> possibly the Chinese govt).
>>> OTOH, nobody here much cares.
>>> So, rant on - it's what Usenet is for. ☄ <--- what is that char?????
>
> http://lomas-assault.net/usenet/z12.jpg
>
> I don't know how to answer the question. Is the zeroeth character also
> null?
/u2604 Comet symbol
followups set
--
RGB
------------------------------
Date: Mon, 9 Mar 2009 03:32:01 -0700 (PDT)
From: Erol Akman <jogsalot75@yahoo.de>
Subject: Re: calculate an average with every data in an array
Message-Id: <d78c6de3-f243-44f3-9044-1e35ebe2f1da@x38g2000yqj.googlegroups.com>
Thank you very much for your thoughts and efforts. It made me realize
how nuts this task really is ;-)
Taken into account that I could make a few educated guesses as Rasmus
Villemoes suggested, I would not have "hundreds of values" but 20 or
even less.
You've said, that you already ran a calculation on your computer with
10 values (?), how did you do that? Could you provide me your code? I
just know the basics:
#! /usr/bin/perl
# calculate an average
use strict;
use warnings;
my @array = qw(1 2 3 4 5 6 7 8 9 10 11);
my $sum = 0;
$sum += $_ for(@array);
my $avg = $sum / scalar(@array);
print "average: ",$avg,"\n";
print "Values that have been used:","\n";
print join("\n",@array), "\n";
print "Number of values: ", scalar(@array), "\n";
Thanks in advance!
Erol
------------------------------
Date: Mon, 9 Mar 2009 03:34:03 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: FAQ 9.8 How do I fetch an HTML file?
Message-Id: <1bc6pf1gm9yil.16cixayvw5j39.dlg@40tude.net>
On Sat, 7 Mar 2009 06:03:01 -0800, PerlFAQ Server wrote:
> The libwww-perl (LWP) modules from CPAN provide a more powerful way to
> do this. They don't require lynx, but like lynx, can still work through
> proxies:
...
illynet.com/hbx.js" type="text/javascript"></script><!--//-->
<!-- END WEBSIDESTORY CODE -->
</body>
</html>
Undefined subroutine &main::parse_html called at html1.pl line 18.
C:\MinGW\source>type html1.pl
# simplest version
use LWP::Simple;
$content = get($URL);
# or print HTML from a URL
use LWP::Simple;
getprint "http://www.perl.com";
# or print ASCII from HTML from a URL
# also need HTML-Tree package from CPAN
use LWP::Simple;
use HTML::Parser;
use HTML::FormatText;
my ($html, $ascii);
$html = get("http://www.perl.com/");
defined $html
or die "Can't fetch HTML from http://www.perl.com/";
$ascii = HTML::FormatText->new->format(parse_html($html));
print $ascii;
# perl html1.pl
C:\MinGW\source>
Is line 18 correct here?:
$ascii = HTML::FormatText->new->format(parse_html($html));
--
larry gates
I suppose one could claim that an undocumented feature has no
semantics. :-(
-- Larry Wall in <199710290036.QAA01818@wall.org>
------------------------------
Date: Mon, 9 Mar 2009 07:44:26 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: FAQ 9.8 How do I fetch an HTML file?
Message-Id: <slrngra3pa.c1l.tadmc@tadmc30.sbcglobal.net>
Larry Gates <larry@example.invalid> wrote:
> use LWP::Simple;
> use HTML::Parser;
> use HTML::FormatText;
> my ($html, $ascii);
> $html = get("http://www.perl.com/");
> defined $html
> or die "Can't fetch HTML from http://www.perl.com/";
> $ascii = HTML::FormatText->new->format(parse_html($html));
> print $ascii;
>
> # perl html1.pl
>
> C:\MinGW\source>
>
> Is line 18 correct here?:
Yes.
It is the 2nd line quoted above that is not correct. It should be:
use HTML::Parse;
However, its docs say:
Disclaimer: This module is provided only for backwards compatibility
with earlier versions of this library. New code should not use this
module, and should really use the HTML::Parser and HTML::TreeBuilder
modules directly, instead.
So the FAQ answer should probably be reworked to use TreeBuilder instead:
use LWP::Simple;
use HTML::TreeBuilder;
use HTML::FormatText;
my ($html, $ascii, $tree);
$html = get("http://www.perl.com/");
defined $html
or die "Can't fetch HTML from http://www.perl.com/";
$tree = HTML::TreeBuilder->new->parse($html);
$ascii = HTML::FormatText->new->format($tree);
print $ascii;
However, we should not use bad practice in our FAQ example code,
so it would better be:
use LWP::Simple;
use HTML::TreeBuilder;
use HTML::FormatText;
my $html = get("http://www.perl.com/");
defined $html
or die "Can't fetch HTML from http://www.perl.com/";
my $tree = HTML::TreeBuilder->new->parse($html);
my $ascii = HTML::FormatText->new->format($tree);
print $ascii;
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Mon, 9 Mar 2009 04:42:27 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Mar 9 2009
Message-Id: <KG82Er.1qvG@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-Blarghy-McBlarghBlargh
http://search.cpan.org/~dhoss/Acme-Blarghy-McBlarghBlargh/
----
App-CMAM-0.01
http://search.cpan.org/~melo/App-CMAM-0.01/
Watch and commit differences
----
App-CMAM-0.02
http://search.cpan.org/~melo/App-CMAM-0.02/
Watch and commit differences
----
App-DualLivedDiff-1.03
http://search.cpan.org/~smueller/App-DualLivedDiff-1.03/
Diff between the perl core and dual-lived modules' CPAN distributions
----
CPANPLUS-Dist-Build-0.13_01
http://search.cpan.org/~bingos/CPANPLUS-Dist-Build-0.13_01/
CPANPLUS plugin to install packages that use Build.PL
----
Catalyst-Controller-Validation-DFV-0.0.3
http://search.cpan.org/~chisel/Catalyst-Controller-Validation-DFV-0.0.3/
check form data
----
Catalyst-Log-Log4perl-1.01
http://search.cpan.org/~bobtfish/Catalyst-Log-Log4perl-1.01/
Log::Log4perl logging for Catalyst
----
Catalyst-Manual-5.7018
http://search.cpan.org/~hkclark/Catalyst-Manual-5.7018/
The Catalyst developer's manual
----
Catalyst-Model-DBIC-Schema-0.23
http://search.cpan.org/~mstrout/Catalyst-Model-DBIC-Schema-0.23/
DBIx::Class::Schema Model Class
----
Catalyst-Plugin-Authentication-0.10011
http://search.cpan.org/~bobtfish/Catalyst-Plugin-Authentication-0.10011/
Infrastructure plugin for the Catalyst authentication framework.
----
ClearCase-Argv-1.44
http://search.cpan.org/~dsb/ClearCase-Argv-1.44/
ClearCase-specific subclass of Argv
----
ExtUtils-CBuilder-0.24_01
http://search.cpan.org/~kwilliams/ExtUtils-CBuilder-0.24_01/
Compile and link C code for Perl modules
----
FCGI-Engine-0.08
http://search.cpan.org/~stevan/FCGI-Engine-0.08/
A flexible engine for running FCGI-based applications
----
Filter-Arguments-0.01
http://search.cpan.org/~dylan/Filter-Arguments-0.01/
Configure and read your command line arguments.
----
FormValidator-Lite-0.01_05
http://search.cpan.org/~tokuhirom/FormValidator-Lite-0.01_05/
lightweight form validation library
----
FormValidator-Lite-0.02
http://search.cpan.org/~tokuhirom/FormValidator-Lite-0.02/
lightweight form validation library
----
Geo-Gpx-0.22
http://search.cpan.org/~andya/Geo-Gpx-0.22/
Create and parse GPX files.
----
Geo-Gpx-0.23
http://search.cpan.org/~andya/Geo-Gpx-0.23/
Create and parse GPX files.
----
Getopt-Long-2.37_03
http://search.cpan.org/~jv/Getopt-Long-2.37_03/
Extended processing of command line options
----
HTML-Tiny-1.05
http://search.cpan.org/~andya/HTML-Tiny-1.05/
Lightweight, dependency free HTML/XML generation
----
HTML-WikiConverter-0.66
http://search.cpan.org/~diberri/HTML-WikiConverter-0.66/
Convert HTML to wiki markup
----
Module-Manifest-0.05
http://search.cpan.org/~adamk/Module-Manifest-0.05/
Parse and examine a Perl distribution MANIFEST file
----
Mouse-0.19
http://search.cpan.org/~sartak/Mouse-0.19/
Moose minus the antlers
----
Net-DNS-ToolKit-0.42
http://search.cpan.org/~miker/Net-DNS-ToolKit-0.42/
tools for working with DNS packets
----
Net-GitHub-0.02
http://search.cpan.org/~fayland/Net-GitHub-0.02/
Perl Interface for github.com
----
Net-Interface-1.009
http://search.cpan.org/~miker/Net-Interface-1.009/
Perl extension to access network interfaces
----
Parse-BBCode-0.08
http://search.cpan.org/~tinita/Parse-BBCode-0.08/
Module to turn BBCode into HTML or plain text
----
Path-Extended-0.10
http://search.cpan.org/~ishigaki/Path-Extended-0.10/
yet another Path class
----
Pod-POM-View-DocBook-0.08
http://search.cpan.org/~andrewf/Pod-POM-View-DocBook-0.08/
DocBook XML view of a Pod Object Model
----
Schedule-Week-1.0
http://search.cpan.org/~maxschube/Schedule-Week-1.0/
Perl extension for creating and manipulating an hourly weekly schedule.
----
Set-IntSpan-Fast-XS-0.05
http://search.cpan.org/~andya/Set-IntSpan-Fast-XS-0.05/
Faster Set::IntSpan::Fast
----
Simo-Wrapper-0.0210
http://search.cpan.org/~kimoto/Simo-Wrapper-0.0210/
Object wrapper to manipulate attrs and methods.
----
Simo-Wrapper-0.0211
http://search.cpan.org/~kimoto/Simo-Wrapper-0.0211/
Object wrapper to manipulate attrs and methods.
----
Squatting-On-HTTP-Engine-0.04
http://search.cpan.org/~beppu/Squatting-On-HTTP-Engine-0.04/
run Squatting apps on top of HTTP::Engine
----
String-Smart-0.4
http://search.cpan.org/~andya/String-Smart-0.4/
Strings that know how to escape themselves.
----
Test-API-0.001
http://search.cpan.org/~dagolden/Test-API-0.001/
Test a list of subroutines provided by a module
----
Test-WWW-Selenium-Catalyst-0.05_99
http://search.cpan.org/~ash/Test-WWW-Selenium-Catalyst-0.05_99/
Test your Catalyst application with Selenium
----
Text-CSV_XS-0.61
http://search.cpan.org/~hmbrand/Text-CSV_XS-0.61/
comma-separated values manipulation routines
----
Text-Trac-0.15
http://search.cpan.org/~mizzy/Text-Trac-0.15/
Perl extension for formatting text with Trac Wiki Style.
----
Tk-Clock-0.25
http://search.cpan.org/~hmbrand/Tk-Clock-0.25/
Clock widget with analog and digital display
----
WWW-Google-PageRank-0.15
http://search.cpan.org/~ykar/WWW-Google-PageRank-0.15/
Query google pagerank of page
----
X11-GUITest-record-0.15
http://search.cpan.org/~mkoderer/X11-GUITest-record-0.15/
Perl implementation of the X11 record extension.
----
YAML-Perl-0.02
http://search.cpan.org/~ingy/YAML-Perl-0.02/
Pure Perl YAML Implementation
----
Zucchini-0.0.15
http://search.cpan.org/~chisel/Zucchini-0.0.15/
turn templates into static websites
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, 9 Mar 2009 02:20:27 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: perl as email client
Message-Id: <1xhenhjepxhnx$.xvcq8502b1k3.dlg@40tude.net>
On Sun, 08 Mar 2009 15:41:26 +0100, M.O.B. i L. wrote:
> use strict;
> use warnings;
> use Mail::IMAPClient;
> use IO::Socket::SSL;
Thanks for your response, mo. One of the hardest parts of getting one of
these projects rolling is figuring out how you're going to imitate the
modules that others use.
The trick for me is to get what I read here on usenet and my actual choices
with activestate to gybe.
When I google for "cpan email pop3" I can't get away from this page
http://kobesearch.cpan.org/htdocs/Email-Folder-POP3/Email/Folder/POP3.html
I do not have this module:
C:\MinGW\source> perl eml1.pl
Can't locate Email/Folder.pm in @INC (@INC contains: C:/Perl/site/lib
C:/Perl/li
b .) at eml1.pl line 1.
BEGIN failed--compilation aborted at eml1.pl line 1.
C:\MinGW\source>type eml1.pl
use Email::Folder;
use Email::FolderType::Net;
my $folder = Email::Folder->new('pop://user:pass@example.com:110');
print $_->header('Subject') for $folder->messages;
# perl eml1.pl
C:\MinGW\source>
What I do have is Mail::POP3Client
http://lomas-assault.net/usenet/z10.jpg
I do now have POP3Client.pm in /site/lib/mail/.
Does anyone have experience with mail::POP3Client? It's 42 k long as a .pm
file. If I'm trying to figure out how to use it without any better
documentation, how would I determine the methods?
--
larry gates
...sometimes collections of stupid utterances can be rather clever. If
my writings are ever published posthumously, they should probably be
called "A Collection of Stupid Utterances", or some such... :-)
-- Larry Wall in <20050303163144.GA5235@wall.org>
------------------------------
Date: Mon, 9 Mar 2009 02:30:42 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: perl as email client
Message-Id: <1gwu276p2r4ue.y0wy38fk9vh0.dlg@40tude.net>
On Sat, 07 Mar 2009 08:12:58 GMT, Peter Wyzl wrote:
> "Larry Gates" <larry@example.invalid> wrote in message
>> Gosh, I would have thought that writing an e-mail client in perl would be
>> as commonplace as ways to calculate pi with fortran.
>
> Net::POP3
>
> From the docs:
>
> SYNOPSIS
> use Net::POP3; # Constructors
> $pop = Net::POP3->new('pop3host');
> $pop = Net::POP3->new('pop3host', Timeout => 60); if
> ($pop->login($username, $password) > 0) {
> my $msgnums = $pop->list; # hashref of msgnum => size
> foreach my $msgnum (keys %$msgnums) {
> my $msg = $pop->get($msgnum);
> print @$msg;
> $pop->delete($msgnum);
> }
> } $pop->quit;
I had to download the Email::Folder::POP3, but now I've got it and we're
rolling:
C:\MinGW\source>perl eml2.pl
Can't call method "login" on an undefined value at eml2.pl line 3.
C:\MinGW\source>
>
> --------------------------------------------------------------------------------
>
> DESCRIPTION
> This module implements a client interface to the POP3 protocol, enabling a
> perl5 application to talk to POP3 servers. This documentation assumes that
> you are familiar with the POP3 protocol described in RFC1939.
What is Perl5?
>
> A new Net::POP3 object must be created with the new method. Once this has
> been done, all POP3 commands are accessed via method calls on the object.
>
>
> Surely you can read the rest yourself...
I'll get on it.
--
larry gates
And other operators aren't so special syntactically, but weird
in other ways, like "scalar", and "goto".
-- Larry Wall in <199711071749.JAA29751@wall.org>
------------------------------
Date: Mon, 9 Mar 2009 02:41:25 -0700
From: Larry Gates <larry@example.invalid>
Subject: Re: perl as email client
Message-Id: <163kvha2yybb6$.3zk61x3canv4$.dlg@40tude.net>
On Sat, 07 Mar 2009 15:51:25 GMT, A. Sinan Unur wrote:
> Larry Gates <larry@example.invalid> wrote in
> news:q98xh61wmkc$.1k26eqqyvwvc0$.dlg@40tude.net:
>
>> Gosh, I would have thought that writing an e-mail client in perl would
>> be as commonplace as ways to calculate pi with fortran.
>
> http://www.unur.com/comp/ppp/delallspam.html
>
> might help you get started.
>
> Sinan
It certainly does:
C:\MinGW\source>perl eml3.pl
Can't locate Lingua/EN/Inflect.pm in @INC (@INC contains: C:/Perl/site/lib
C:/Pe
rl/lib .) at eml3.pl line 52.
BEGIN failed--compilation aborted at eml3.pl line 52.
C:\MinGW\source>type eml3.pl
#!/usr/bin/perl
use strict;
use warnings;
$| = 1;
use constant SEVERITY => 5;
use Mail::POP3Client;
use Term::ReadKey;
my $user = shift;
my $pop = Mail::POP3Client->new(HOST => '127.0.0.1', PORT => 9999);
my $pass = prompt_password();
print "\n";
$pop->User($user);
$pop->Pass($pass);
$pop->Connect or die $pop->Message;
my $count = $pop->Count;
$count >= 0 or die "Failed to get message count.\n";
$count > 0 or die "No messages in mailbox.\n";
my @to_delete;
print "Scanning messages: ";
my $to_delete = 0;
for my $msg_num (1 .. $count) {
my @headers = $pop->Head($msg_num);
for my $h (@headers) {
if($h =~ /^X-Spam-Level: (\*+)/) {
if(SEVERITY <= scalar ($1 =~ tr/*/*/)) {
$to_delete += 1;
$pop->Delete($msg_num);
print "\b*>";
} else {
print "\b->";
}
}
}
}
print "\b ... done\n";
use Lingua::EN::Inflect qw( PL );
if( $to_delete ) {
printf "%d %s will be deleted. Commit: [Y/N]?\n",
$to_delete, PL('message', $to_delete);
$pop->Reset unless yes();
}
$pop->Close;
print "OK\n";
sub yes {
while(my $r = <STDIN>) {
$r = lc substr $r, 0, 1;
return 1 if $r eq 'y';
next unless $r eq 'n';
last;
}
0;
}
sub prompt_password {
print 'Password: ';
ReadMode 2;
my $pass = ReadLine 0;
ReadMode 0;
chomp $pass;
return $pass;
}
__END__
# perl eml3.pl
C:\MinGW\source>
The good news here is that I see a bunch of goodies as far as POP3's
methods, and I don't fail until I get to:
use Lingua::EN::Inflect qw( PL );
What does this module do to filter out spam?
--
larry gates
Randal can write one-liners again. Everyone is happy, and peace spreads
over the whole Earth.
-- Larry Wall in <199705101952.MAA00756@wall.org>
------------------------------
Date: Mon, 9 Mar 2009 07:52:38 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: perl as email client
Message-Id: <slrngra48m.c1l.tadmc@tadmc30.sbcglobal.net>
Larry Gates <larry@example.invalid> wrote:
> On Sat, 07 Mar 2009 08:12:58 GMT, Peter Wyzl wrote:
>> DESCRIPTION
>> This module implements a client interface to the POP3 protocol, enabling a
>> perl5 application to talk to POP3 servers. This documentation assumes that
>> you are familiar with the POP3 protocol described in RFC1939.
>
>
> What is Perl5?
The version of perl that came after version 4 of perl (perldoc perlhist).
Perl5 was a huge change to Perl, it introduced references and
lexical variables to the language for example.
For quite some time folks said "Perl5" rather than just "Perl" so that
readers would know not to try the code with "Perl4".
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Mon, 9 Mar 2009 11:25:18 +0100
From: gamo <gamo@telecable.es>
Subject: Re: What-if algorithm
Message-Id: <alpine.LNX.2.00.0903091121150.18142@jvz.es>
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--8323328-1111500681-1236594318=:18142
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: QUOTED-PRINTABLE
On Sun, 8 Mar 2009, Xho Jingleheimerschmidt wrote:
> gamo wrote:
> > On Sun, 8 Mar 2009, Peter J. Holzer wrote:
> >=20
> > > > It does what you had said, BUT it's not the solver.
> > > Which is probably completely irrelevant to my argument. The function =
you
> > > and I meant (however it is called) does not grep over some values sto=
red
> > > in a spreadsheet but tries to find a root of the equation (by whateve=
r
> > > means - this is irrelevant, too). So J=FCrgen's reply that "it is hig=
hly
> >=20
> > No, it's not irrelevant. It's the key to solve the problem.
> > Playing with a financial function, the bisection method works,
>=20
> Depending on what your "financial function" is.
>=20
Put a contra-example.
--=20
http://www.telecable.es/personales/gamo/
"Was it a car or a cat I saw?"
perl -E 'say 111_111_111**2;'
--8323328-1111500681-1236594318=:18142--
------------------------------
Date: Sun, 08 Mar 2009 21:07:37 -0700
From: Tim Greer <tim@burlyhost.com>
Subject: Re: Why Perl 5.10.0 is still considered stable?
Message-Id: <eC0tl.61624$aZ3.43333@newsfe01.iad>
Peter J. Holzer wrote:
> Debian and Fedora are independent distributions. They may or may not
> apply fixes from bleadperl to their packages.
>
Yes, definitely. I don't use either of those dists and I'd not expect
them to have the same release builds in their Perl packages. I just
saw a report that the bug was fixed for Debian in the 0.17 "package"
build.
--
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: 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 2262
***************************************