[24725] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6880 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 18 18:06:06 2004

Date: Wed, 18 Aug 2004 15:05: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           Wed, 18 Aug 2004     Volume: 10 Number: 6880

Today's topics:
    Re: could I use perl to write a script to logon multipl <end@dream.life>
    Re: could I use perl to write a script to logon multipl <end@dream.life>
    Re: cpan update: 106 installed modules have no parseabl (John M. Gamble)
    Re: Earthquake forecasting program   Aug. 16, 2004 (Oriel36)
    Re: Earthquake forecasting program   Aug. 16, 2004 <jwkenne@attglobal.net>
    Re: editing perl script through TEXTAREA ctcgag@hotmail.com
    Re: editing perl script through TEXTAREA <noreply@gunnar.cc>
    Re: editing perl script through TEXTAREA <gnari@simnet.is>
    Re: editing perl script through TEXTAREA <noreply@gunnar.cc>
    Re: editing perl script through TEXTAREA <flavell@ph.gla.ac.uk>
    Re: editing perl script through TEXTAREA <noreply@gunnar.cc>
    Re: editing perl script through TEXTAREA (anita)
    Re: Forcing Array Context (Peter Kay)
    Re: Forcing Array Context <mritty@gmail.com>
    Re: Forcing Array Context (Randal L. Schwartz)
    Re: Getting position from unpack (was: "join on space i (J. Romano)
        How to parse email in real time? <SaveWorldFromAids@alexa.com>
    Re: How to parse email in real time? <morton@lsupcaemnt.com>
    Re: How to parse email in real time? <ihs_4664@yahoo.com>
    Re: How to parse email in real time? <SaveWorldFromAids@alexa.com>
    Re: How to parse email in real time? <morton@lsupcaemnt.com>
    Re: How to parse email in real time? (Kenny McCormack)
    Re: How to parse email in real time? <bmarcum@iglou.com.urgent>
    Re: How to parse email in real time? <postmaster@castleamber.com>
    Re: How to parse email in real time? <opengeometry@yahoo.ca>
    Re: How to parse email in real time? <zebee@zip.com.au>
    Re: Installing Perl in OS/2? <nospam-abuse@ilyaz.org>
    Re: My own handy Pocket Reference notes (please share y (J. Romano)
        Mysql->Connect and Ports (Todd Hlavacek)
        Net::SFTP ssh_args => [ ] syntax question... (Icari)
        Non match word list with Regular Expressions (Chris Chandler)
    Re: Non match word list with Regular Expressions <postmaster@castleamber.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 18 Aug 2004 23:23:44 +0800
From: Alont <end@dream.life>
Subject: Re: could I use perl to write a script to logon multiple web forum?
Message-Id: <412a7479.35843765@130.133.1.4>

??

at Wed, 18 Aug 2004 16:29:39 +0200
Tore Aursand <tore@aursand.no>×íõ¸õ¸µÄÄØà«µÀ:--
>*must...res...ist...reply...ing....to....this...post*
>
>Damn! :)


      Your fault as a Government is My failure as a citizen


------------------------------

Date: Wed, 18 Aug 2004 23:24:33 +0800
From: Alont <end@dream.life>
Subject: Re: could I use perl to write a script to logon multiple web forum?
Message-Id: <412b7491.35867062@130.133.1.4>

I really difficult to understand what you say :-)

at Wed, 18 Aug 2004 16:29:39 +0200
Tore Aursand <tore@aursand.no>×íõ¸õ¸µÄÄØà«µÀ:--
>*must...res...ist...reply...ing....to....this...post*
>
>Damn! :)


      Your fault as a Government is My failure as a citizen


------------------------------

Date: Wed, 18 Aug 2004 19:18:59 +0000 (UTC)
From: jgamble@ripco.com (John M. Gamble)
Subject: Re: cpan update: 106 installed modules have no parseable version number
Message-Id: <cg0a33$hae$8@e250.ripco.com>

In article <cfsmch$9r1$2@mamenchi.zrz.TU-Berlin.DE>,
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>Steve Kelem  <steve@kelem.net> wrote in comp.lang.perl.misc:
>> When I run CPAN.pm and type the option "r" (reinstall recommendations),
>> I get the message
>> 
>> 106 installed modules have no parseable version number
>> 
>> Why so many modules without version numbers?
>
>Ask the authors.  There is no enforcement to have a version number,
>so some modules don't have one.
>

Ultimate responsibility does rest with the authors, but...

How difficult would it be for CPAN to reject versionless modules?
I don't think it would set off too many flames if this were enforced.

(On a much less important, but it still bugs me, note, anyone who
leaves in the "Perl extension for blah blah blah" synopsis should
be flogged.  Err, i mean, should have their module rejected.  Yeah,
that's what i meant.)

-- 
	-john

February 28 1997: Last day libraries could order catalogue cards
from the Library of Congress.


------------------------------

Date: 18 Aug 2004 08:25:12 -0700
From: geraldkelleher@hotmail.com (Oriel36)
Subject: Re: Earthquake forecasting program   Aug. 16, 2004
Message-Id: <273f8e06.0408180725.205ff86c@posting.google.com>

Bob Officer <bobofficers@invalid.net> wrote in message news:<1v86i0908fnd4b2jbj3sm1gl6q4ov0rr3r@4ax.com>...
> On Tue, 17 Aug 2004 06:55:50 GMT, in sci.geo.earthquakes, "edgrsprj"
> <edgrsprj@ix.netcom.com> wrote:
> 
> >
> >"Jaxtraw" <jaxtraw@nospamnobigfoot.com> wrote in message
> >news:1092684544.19111.0@ersa.uk.clara.net...
> >> "edgrsprj" <edgrsprj@ix.netcom.com> wrote in message
> >> news:0f1Uc.23551$nx2.17009@newsread2.news.atl.earthlink.net...
> >> > August 16, 2004   Posted to sci.geo.earthquakes and other Newsgroups
>  
> >>
> >> Intriguing, but it seems to me you should test also for false negatives.
> >> ...
> >
> >August 17, 2004
> >
> >Hi Ian,  Thanks for the comments.
> >
> >At the moment this what might be described as "Any port in the storm
> >technology."  That means that we have a desperate situation where
> >earthquakes are claiming lives without anything to stop that from happening.
> >More than 25,000 people reportedly perished last December in Iran from an
> >unexpected earthquake.  And the immediate goal is to find anything at all
> >which can help.
> >
> >I know of at least two promising looking technologies which are being used
> >in China.  But each of the detector units runs something like $10,000 U.S.
> >You need multiple units to cover a given area plus all of the support
> >personnel.  And they still apparently miss an unacceptably high percentage
> >of the destructive earthquakes.
> 
> That means the system doesn't work...
> 
> >One of the reasons that my program looks so attractive at the moment is the
> 
> Only to you... but then it isn't really your program. you didn't gather the
> data or write the computer program.  You are a CRACKPOT.

You do astrology for goodness sake !,you look for correlations in
planetary positions on human existence  and that just takes a google
search on your posting history.The poster is in no way offensive,even
if his data is like finding order in white noise,billions of public
funding is going to do the same thing.

http://zebu.uoregon.edu/~imamura/123/lecture-1/cmbr.html

If a fraction of that money was turned to geology,departments would
not be closed down and more immediate terrestial concerns would take
priority much less appreceating the magnificence of the whole
thing.The inability of geologists to make the astronomical leap as a
natural progression of plate movement assures that
fundamentalism,astrology and barely concealed empirical silliness will
flourish.

You produce the slogan of a crackpot on this man while  guys receive
billions for having the Earth at the center of the universe,turn it
what way you will,that is what it amounts to when you decide an
alternative approach to the 'past'.

-------------------------------------------------------------------------------
>That's why I will never be an astrologer. I just can't see the
>patterns in charts to save my life. When I see what Keera and Ken can
>come up with, it blows my mind. 

Patterns are easy. Finding significant patters and then to see the
significance of the aspect is hard. Then to make sure it fits all the
time
is even harder. 

For example is the Venus/Uranus myth.

>Ah well, such pretty stars...

Hermetic principle is astrology's fundamental rule, and it fails in
every
testing.

Bob Officer

------------------------------------------------------------------------------


------------------------------

Date: Wed, 18 Aug 2004 15:31:05 GMT
From: "John W. Kennedy" <jwkenne@attglobal.net>
Subject: Re: Earthquake forecasting program   Aug. 16, 2004
Message-Id: <ZCKUc.23834$vc4.9055174@news4.srv.hcvlny.cv.net>

Oriel36 wrote:
> All gravitational observations are based on the sidereal format which
> is the only means to determine a geocentric/heliocentric orbital
> equivalency.After Kepler,Galileo and others struggled for recognition
> of the heliocentric motion of the planets,Newton reverted back to an
> odd mixture of geocentrism and heliocentrism to get his gravitational
> agenda to work.He used Flamsteed erroneous proof for axial
> rotational/stellar circumpolar equivalency and morphed it into a
> geocentric/heliocentric orbital equivalency.
> 
> 
> "PHÆNOMENON IV.
> That the fixed stars being at rest, the periodic times of the five
> primary planets, and (whether of the sun about the earth, or) of the
> earth about the sun, are in the sesquiplicate proportion of their mean
> distances from the sun.
> 
> http://members.tripod.com/~gravitee/phaenomena.htm
> 
> I will put it another way,at dawn,the Earth axially rotates out of its
> orbital shadow but if you are the minset of sunrise and sunset you
> will place great stake in the position of the Sun in the sky and this
> is exactly where you are at, so is everyone else thanks to Newton.In
> the early 1920's they jettisoned Newton's geocentric/heliocentric
> framehopping and resorted to homocentrism which is why the 'every
> valid point is the center of the universe' is paraded today for the
> sake of the 'laws of physics'.

Yes, folks, you read it right.  Not only is "Oriel36" an 
Einstein-denier, he is also a Newton-denier, as I have verified from his 
postings elsewhere.

Can't we all just *plonk* him?

-- 
John W. Kennedy
"Compact is becoming contract,
Man only earns and pays."
   -- Charles Williams.  "Bors to Elayne:  On the King's Coins"


------------------------------

Date: 18 Aug 2004 17:21:47 GMT
From: ctcgag@hotmail.com
Subject: Re: editing perl script through TEXTAREA
Message-Id: <20040818132147.762$Bb@newsreader.com>

anita1766@yahoo.com (anita) wrote:
> Lets just say I am editing some file, any file through the form... Not
> necessarily a perl script. That- is a good example because it tends to
> have a lot of special characters.
> One other person suggested that I save before converting. I am not
> sure what was meant by that.
>
> From what I understand, my file has to be processed to replace all the
> special HTML chars before display (so browser wont complain) and once
> the user edits and tries to save it through the form, it has to be
> stripped off the special entities, so it can be saved...

From what I understand, the textarea() sub (or method) of CGI module will
automatically do this conversion for you on the way to html, and the
param() sub or method (or something upstream of it) will automatically
do the reverse conversion on the way back.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: Wed, 18 Aug 2004 19:25:13 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <2ohhqhFan5v5U1@uni-berlin.de>

ctcgag@hotmail.com wrote:
> From what I understand, the textarea() sub (or method) of CGI
> module will automatically do this conversion for you on the way to
> html,

Sounds plausible.

> and the param() sub or method (or something upstream of it) will
> automatically do the reverse conversion on the way back.

Don't understand. What do you mean by that?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Wed, 18 Aug 2004 17:38:09 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <cg0425$9il$1@news.simnet.is>

"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:2ohhqhFan5v5U1@uni-berlin.de...
> ctcgag@hotmail.com wrote:
> > From what I understand, the textarea() sub (or method) of CGI
> > module will automatically do this conversion for you on the way to
> > html,
>
> Sounds plausible.
>
> > and the param() sub or method (or something upstream of it) will
> > automatically do the reverse conversion on the way back.
>
> Don't understand. What do you mean by that?

he means that a character like '&' will be sent by
the browser encoded (&amp;), but param() will
return it as '&' again.
so if you use textarea() and param(), you never have to
worry about it.

gnari






------------------------------

Date: Wed, 18 Aug 2004 20:46:12 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <2ohmiiFaf3moU1@uni-berlin.de>

gnari wrote:
> Gunnar Hjalmarsson wrote:
>> ctcgag@hotmail.com wrote:
>>> and the param() sub or method (or something upstream of it)
>>> will automatically do the reverse conversion on the way back.
>> 
>> Don't understand. What do you mean by that?
> 
> he means that a character like '&' will be sent by the browser
> encoded (&amp;), but param() will return it as '&' again.

There is a lot of confusion here.

A '&' character that is submitted via a textarea control is URI
encoded, not converted to the corresponding HTML entity. Accordingly,
after URI decoding, it's still a '&'.

It's when you want to display content initially in a textarea field
that you should first convert certain characters to HTML entities, but
if you for instance have:

     <textarea name="demo">Smith &amp; Son Co.</textarea>

the browser will convert the '&amp;' to '&' and display it as '&'
right away, i.e. before submitting.

So my point, which I also tried to illustrate with a little program
in another post in this thread, is that there is never a need for the
Perl program to do any "reverse conversion" of HTML entities.

> so if you use textarea() and param(), you never have to worry about
> it.

No comments.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Wed, 18 Aug 2004 20:20:19 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <Pine.LNX.4.61.0408182000340.3030@ppepc56.ph.gla.ac.uk>

On Wed, 18 Aug 2004, Gunnar Hjalmarsson wrote:

> There is a lot of confusion here.

Nothing new there, then...  :-}

> A '&' character that is submitted via a textarea control is URI
> encoded, not converted to the corresponding HTML entity. Accordingly,
> after URI decoding, it's still a '&'.

Agreed.

> It's when you want to display content initially in a textarea field
> that you should first convert certain characters to HTML entities, but
> if you for instance have:
> 
>     <textarea name="demo">Smith &amp; Son Co.</textarea>
> 
> the browser will convert the '&amp;' to '&' and display it as '&'
> right away, i.e. before submitting.

Spot on.

> So my point, which I also tried to illustrate with a little program
> in another post in this thread, is that there is never a need for the
> Perl program to do any "reverse conversion" of HTML entities.

As a matter of principle you're correct here.  But that isn't quite 
true in practice, as I'll deal with in a moment.

As usual, it's all a matter of dividing the problem up into its 
component parts, and understanding how each one works separately, 
before assembling them into a working application.

But, over and above this, if folks go pasting weird characters into 
their form submission (and there's no way you can stop them doing so), 
then browsers do strange things with them.  As the Perl Encode 
documentation so engagingly remarks:

  It is beyond the power of words to describe the way HTML
  browsers encode non-ASCII form data. 

   - http://www.perldoc.com/perl5.8.0/lib/Encode/Supported.html

And there are some browsers (or should I say "browser-like operating 
system components"?) which, when the user feeds into a form a 
character which cannot be represented in the prevailing character 
encoding, will turn it into &#number; or even into &entityname; format 
for submission.

On arrival at the server, of course, the server-side process can have 
no idea whether the user typed just a curly-quote character, or typed 
the ASCII string &#8220; (ampersand, hash, 8, 2, 2, 0, semicolon). By 
that time they are indistinguishable.  The behaviour in this situation 
is undefined anyway, and browser developers have addressed it in 
various different ways as they saw fit.

But Perl is only a small part of this problem - the major issues
really need to be hammered out on a suitable WWW-related group.
Where one might even get referred to my no-longer-quite-new 
tutorial-ish page on the topic, 
http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html

have fun


------------------------------

Date: Wed, 18 Aug 2004 22:02:12 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: editing perl script through TEXTAREA
Message-Id: <2ohr19Fb44spU1@uni-berlin.de>

Alan J. Flavell wrote:
> And there are some browsers (or should I say "browser-like
> operating system components"?) which, when the user feeds into a
> form a character which cannot be represented in the prevailing
> character encoding, will turn it into &#number; or even into
> &entityname; format for submission.

Now we are talking i18n it seems...

> On arrival at the server, of course, the server-side process can
> have no idea whether the user typed just a curly-quote character,
> or typed the ASCII string &#8220; (ampersand, hash, 8, 2, 2, 0,
> semicolon).

Not even CGI.pm's param() function/method, I presume. ;-)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: 18 Aug 2004 14:35:05 -0700
From: anita1766@yahoo.com (anita)
Subject: Re: editing perl script through TEXTAREA
Message-Id: <1a1fc02.0408181335.8cfdbc5@posting.google.com>

Sorry did not mean to offend you with "Other person" remark!
Anyway I think I get it now- script makes it very clear. 
Basically the browser sends back whatver it has DISPLAYED when I say
submit, not what is in the source. I kept thinking that if it sent the
browser say a &lt and displayed it as <, then when it came back it
would still comeback as &lt. Now I see it does not. So what comes back
is the display of &lt ie., <

That way the conversion returns it to &lt before saving it again. 
And if the user typed in &lt, that will be sent in as &lt and after
conversion gets becomes &amp;lt, so gets displayed the same as the
used typed in.

Thankyou 
Anita


------------------------------

Date: 18 Aug 2004 10:27:20 -0700
From: peterkayatwork@yahoo.com (Peter Kay)
Subject: Re: Forcing Array Context
Message-Id: <3081c9ae.0408180927.3c04e313@posting.google.com>

Tim Hammerquist <tim@vegeta.ath.cx> wrote in message news:<slrnci51tl.g6i.tim@vegeta.saiyix>...

>   Prototypes serve
> a different purpose in Perl and are almost never necessary.  Don't worry
> abou them for now.
> 

So what is the official purpose of prototypes in Perl?  They certainly
forced me to make sure I passed in at least some elements ;-)

--Peter


------------------------------

Date: Wed, 18 Aug 2004 14:15:15 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: Forcing Array Context
Message-Id: <20040818140658.J2996@barbara.cs.rpi.edu>

On Wed, 18 Aug 2004, Peter Kay wrote:

> Tim Hammerquist <tim@vegeta.ath.cx> wrote in message news:<slrnci51tl.g6i.tim@vegeta.saiyix>...
>
> >   Prototypes serve
> > a different purpose in Perl and are almost never necessary.  Don't worry
> > abou them for now.
> >
>
> So what is the official purpose of prototypes in Perl?  They certainly
> forced me to make sure I passed in at least some elements ;-)

I've only ever found two uses for prototypes:
1) To generate a compile-time error when you accidentally call a
subroutine "the wrong way".
2) To automatically create a reference an array passes as a parameter,
rather than allowing the array to 'flatten' along with the other
parameters into @_

Ex of 2:


#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;

sub foo;
sub bar(\@\@);

my @let = qw/a b c/;
my @num = qw/1 2 3/;

foo(@let, @num);
bar(@let, @num);

sub foo {
   #Here, we have:
   #  $_[0] = 'a';
   #  $_[1] = 'b';
   #  $_[2] = 'c';
   #  $_[3] = '1';
   #  $_[4] = '2';
   #  $_[5] = '3';
   print Dumper(\@_);
}

sub bar (\@\@) {
   #Here, we have:
   #  $_[0] = ['a', 'b', 'c'];
   #  $_[1] = ['1', '2', '3'];
   print Dumper(\@_);
}

__END__

Paul Lalli


------------------------------

Date: 18 Aug 2004 11:26:49 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Forcing Array Context
Message-Id: <86vffgti8m.fsf@blue.stonehenge.com>

>>>>> "Peter" == Peter Kay <peterkayatwork@yahoo.com> writes:

Peter> So what is the official purpose of prototypes in Perl?  They certainly
Peter> forced me to make sure I passed in at least some elements ;-)

It permits you to write weird subroutines that parse in the same manner
as some of the odder built-ins.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


------------------------------

Date: 18 Aug 2004 14:44:19 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Re: Getting position from unpack (was: "join on space instead of comma")
Message-Id: <b893f5d4.0408181344.2bde573b@posting.google.com>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<cfnsin$87c$1@mamenchi.zrz.TU-Berlin.DE>...
> 
> In this case it isn't even necessary.  Just make a copy of the rest
> of the string using an additional "a*" template.
> 
>     my $string = "\x00\x01\x03\x00\x01\xff\x01\x0f";
>     my @x = unpack '@2 c/C a*', $string;
>     $string = pop @x;

   Hey, thanks, Anno!  Your solution is a lot more elegant (and works
far better) than the one I was thinking about.

   Of course, if I wanted to find the position after the "@2 c/C"
template without modifying $string, I could do so very easily (by
basically using your technique) like this:

      my $string = "\x00\x01\x03\x00\x01\xff\x01\x0f";
      my @x = unpack "@2 c/C a*", $string;
      my $position = length($string) - length(pop @x);

That way I can start unpacking $string again at $position.

   Thanks again!

   -- Jean-Luc


------------------------------

Date: Wed, 18 Aug 2004 15:33:36 GMT
From: "http://links.i6networks.com" <SaveWorldFromAids@alexa.com>
Subject: How to parse email in real time?
Message-Id: <kFKUc.1796255$Ar.23133@twister01.bloor.is.net.cable.rogers.com>

What I want to make is something to automatically analyzing the email
received

Is there a way to parse email in real time in Perl or Shell, assuming the
script is sitting with the mail server.

I looked into the email format, sometimes, it has something like =3D =0 at
the end of line. Sometimes, it email looks a like a binary file, but it
should be text file as only text and html are in the file.







------------------------------

Date: Wed, 18 Aug 2004 10:59:30 -0500
From: Ed Morton <morton@lsupcaemnt.com>
Subject: Re: How to parse email in real time?
Message-Id: <cfvud4$enl@netnews.proxy.lucent.com>



http://links.i6networks.com wrote:
> What I want to make is something to automatically analyzing the email
> received
> 
> Is there a way to parse email in real time in Perl or Shell, assuming the
> script is sitting with the mail server.
> 
> I looked into the email format, sometimes, it has something like =3D =0 at
> the end of line. Sometimes, it email looks a like a binary file, but it
> should be text file as only text and html are in the file.
> 
> 

Check out procmail (http://www.procmail.org/) and formail (google).

	Ed.



------------------------------

Date: Wed, 18 Aug 2004 10:08:09 -0600
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: How to parse email in real time?
Message-Id: <41237EE9.4090601@yahoo.com>

http://links.i6networks.com wrote:
 > What I want to make is something to automatically analyzing the email
 > received
 >
 > Is there a way to parse email in real time in Perl or Shell, assuming the
 > script is sitting with the mail server.

procmail can invoke any executable or script on incoming messages:
http://www.procmail.org/

-- 
Kevin Rodgers



------------------------------

Date: Wed, 18 Aug 2004 16:15:34 GMT
From: "http://links.i6networks.com" <SaveWorldFromAids@alexa.com>
Subject: Re: How to parse email in real time?
Message-Id: <GgLUc.1797057$Ar.191568@twister01.bloor.is.net.cable.rogers.com>

> http://links.i6networks.com wrote:
> > What I want to make is something to automatically analyzing the email
> > received
> >
> > Is there a way to parse email in real time in Perl or Shell, assuming
the
> > script is sitting with the mail server.
> >
> > I looked into the email format, sometimes, it has something like =3D =0
at
> > the end of line. Sometimes, it email looks a like a binary file, but it
> > should be text file as only text and html are in the file.
> >
> >
>
> Check out procmail (http://www.procmail.org/) and formail (google).
>

The file is C based source codes. How do I install it on the server as I
don't have admin access to it. Is there something similar to it in
Perl/PHP/Shell?

Is ProcMail runable on Windows?




------------------------------

Date: Wed, 18 Aug 2004 11:39:57 -0500
From: Ed Morton <morton@lsupcaemnt.com>
Subject: Re: How to parse email in real time?
Message-Id: <cg00ot$fpk@netnews.proxy.lucent.com>



http://links.i6networks.com wrote:

>>http://links.i6networks.com wrote:
>>
>>>What I want to make is something to automatically analyzing the email
>>>received
>>>
>>>Is there a way to parse email in real time in Perl or Shell, assuming
> 
> the
> 
>>>script is sitting with the mail server.
>>>
>>>I looked into the email format, sometimes, it has something like =3D =0
> 
> at
> 
>>>the end of line. Sometimes, it email looks a like a binary file, but it
>>>should be text file as only text and html are in the file.
>>>
>>>
>>
>>Check out procmail (http://www.procmail.org/) and formail (google).
>>
> 
> 
> The file is C based source codes. How do I install it on the server as I
> don't have admin access to it. Is there something similar to it in
> Perl/PHP/Shell?
> 
> Is ProcMail runable on Windows?
> 

I expect most of the above questions are addressed in the FAQs on that page.

	Ed.



------------------------------

Date: Wed, 18 Aug 2004 17:17:48 GMT
From: gazelle@yin.interaccess.com (Kenny McCormack)
Subject: Re: How to parse email in real time?
Message-Id: <cg03co$j2n$1@yin.interaccess.com>

In article <GgLUc.1797057$Ar.191568@twister01.bloor.is.net.cable.rogers.com>,
http://links.i6networks.com <SaveWorldFromAids@alexa.com> wrote:
 ...
>> Check out procmail (http://www.procmail.org/) and formail (google).
>>
>
>The file is C based source codes. How do I install it on the server as I
>don't have admin access to it.

Do you have access to a C compiler?

>Is there something similar to it in Perl/PHP/Shell?

Probably.  I'd never use it, though.

>Is ProcMail runable on Windows?

O/T in this NG.  Try down the hall...



------------------------------

Date: Wed, 18 Aug 2004 13:24:49 -0400
From: Bill Marcum <bmarcum@iglou.com.urgent>
Subject: Re: How to parse email in real time?
Message-Id: <10gcv1-u2f.ln1@don.localnet>

["Followup-To:" header set to comp.unix.shell.]
On Wed, 18 Aug 2004 15:33:36 GMT, http://links.i6networks.com 
  <SaveWorldFromAids@alexa.com> wrote:
> What I want to make is something to automatically analyzing the email
> received
>
> Is there a way to parse email in real time in Perl or Shell, assuming the
> script is sitting with the mail server.
>
> I looked into the email format, sometimes, it has something like =3D =0 at
> the end of line. Sometimes, it email looks a like a binary file, but it
> should be text file as only text and html are in the file.
>
That sounds like quoted-printable encoding.  If you can edit the email 
to add these header lines, your mail client might decode it:
  Content-Type: text/plain
  Content-Transfer-Encoding: quoted-printable
  Mime-Version: 1.0



-- 
   Liberals don't believe they deserve anything they own; conservatives think   
   they're entitled to everything they've stolen.                               


------------------------------

Date: 18 Aug 2004 18:28:56 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: How to parse email in real time?
Message-Id: <Xns95498925EF505castleamber@130.133.1.4>

"http://links.i6networks.com" <SaveWorldFromAids@alexa.com> wrote in
news:kFKUc.1796255$Ar.23133@twister01.bloor.is.net.cable.rogers.com: 

> What I want to make is something to automatically analyzing the email
> received

For Spam?

> Is there a way to parse email in real time in Perl or Shell, assuming
> the script is sitting with the mail server.

I use spamassassin for this (for spam that is). Written in Perl ;-)

-- 
John                    Small Perl scripts:http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


------------------------------

Date: 18 Aug 2004 20:24:01 GMT
From: William Park <opengeometry@yahoo.ca>
Subject: Re: How to parse email in real time?
Message-Id: <2ohs70Far3m6U1@uni-berlin.de>

In <comp.unix.shell> http://links.i6networks.com
<SaveWorldFromAids@alexa.com> wrote:
> What I want to make is something to automatically analyzing the email
> received
> 
> Is there a way to parse email in real time in Perl or Shell, assuming
> the script is sitting with the mail server.
> 
> I looked into the email format, sometimes, it has something like =3D
> =0 at the end of line. Sometimes, it email looks a like a binary file,
> but it should be text file as only text and html are in the file.

Steps that are involve are the same as spam filtering.  For that,
standard answer is
    man procmail procmailrc procmailex
    man formail
asuming you're running Linux.  For Windows, I've heard the
www.cygwin.org has something offer.  Though I don't know whether you can
invoke Procmail from whatever MTA you're running.

-- 
William Park <opengeometry@yahoo.ca>
Open Geometry Consulting, Toronto, Canada


------------------------------

Date: 18 Aug 2004 22:02:03 GMT
From: Zebee Johnstone <zebee@zip.com.au>
Subject: Re: How to parse email in real time?
Message-Id: <slrnci7k8q.s4k.zebee@zeus.zipworld.com.au>

In comp.lang.perl.misc on Wed, 18 Aug 2004 16:15:34 GMT
http://links.i6networks.com <SaveWorldFromAids@alexa.com> wrote:
>>
> 
> The file is C based source codes. How do I install it on the server as I
> don't have admin access to it. Is there something similar to it in
> Perl/PHP/Shell?
> 

YOu could look at the cpan module Mail::Audit and write a perlscript
using that.

I use it instead of procmail.

You will probably have to describe the exact problem and setup in order
to get useful information.  Such as is this "server" a machine you read
mail on, or one you pop mail from?  What ability do you have to run the
mail through anything?


Zebee

-- 
Zebee Johnstone (zebee@zip.com.au), proud holder of
aus.motorcycles Poser Permit #1.
"Motorcycles are like peanuts... who can stop at just one?"


------------------------------

Date: Wed, 18 Aug 2004 19:13:52 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Installing Perl in OS/2?
Message-Id: <cg09pg$2pn4$1@agate.berkeley.edu>

[A complimentary Cc of this posting was NOT [per weedlist] sent to
Peter Weilbacher
<pweilba@gwdg.de>], who wrote in article <F3cu0n62uTsd-pn2-b6QpFZrVUdCG@gaston.Weilbacher.org>:
> I would use the one from 
> <http://www.cpan.org/authors/id/I/IL/ILYAZ/os2/582+/>, the file 
> README.1st is what you should read first...
> Don't know why Ilya does not put that into the main ports/os2 directory,
> it works fine here since beginning of the year. Perhaps he reads this 
> and enlightens us?

If you know whom one can ask to change the layout of ports/os2, then
probably you can ask yourselves, right? ;-) I have only (a partial)
control over id/ILYAZ...

Hint, hint.  1/2 ;-)

Hope this helps,
Ilya


------------------------------

Date: 18 Aug 2004 08:07:07 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Re: My own handy Pocket Reference notes (please share your own also)
Message-Id: <b893f5d4.0408180707.8d3d236@posting.google.com>

IneverReadAnythingSentToMe@hotmail.com (David Filmer) wrote in message news:<e4c916dd.0408111652.3099c07c@posting.google.com>...
>
> Please feel free to make corrections or add your own!   - DavidFilmer

Dear David,

   I hope it's not too late to share my own, but here's one that I
picked up from reading O'Reilly's "Learning Perl" (the "llama book")
by Randal L. Schwartz and Tom Phoenix:

=================================
If you have a non-complex hash with unique values (as well as unique
keys), you can swap the keys and values with a call to the reverse()
function:

   %states = (AZ => 'Arizona', CO => 'Colorado', NY => 'New York');
      # Make the %abbr hash be the same as %states but
      # with the keys and values swapped:
   %abbr = reverse %states;
      # Now %abbr is equivalent to:
      # %abbr = (Arizona => 'AZ', Colorado => 'CO', 'New York' =>
'NY');
=================================

   And here's another:

=================================
Normally, to compile and install a Perl module from CPAN on a Unix
system, you uncompress it and type:

   perl Makefile.PL
   make
   make test

But this will usually only work if you have superuser access.  Without
superuser access, you can still install it locally, and this is
normally done by replacing the "perl Makefile.PL" line with:

   perl Makefile.PL PREFIX=/home_dir_path/perl_dir

(where /home_dir_path/perl_dir is the path to the directory where you
want your local perl modules installed).  However, sometimes just
specifying PREFIX is not enough, and you must specify more parameters.
 If this is the case, try the following line instead:

   perl Makefile.PL \
         PREFIX=/home_dir_path/perl_dir \
         INSTALLPRIVLIB=/home_dir_path/perl_dir/lib/perl5 \
         INSTALLSCRIPT=/home_dir_path/perl_dir/bin \
         INSTALLSITELIB=/home_dir_path/perl_dir/lib/perl5/site_perl \
         INSTALLBIN=/home_dir_path/perl_dir/bin \
         INSTALLMAN1DIR=/home_dir_path/perl_dir/perl5/man \
         INSTALLMAN3DIR=/home_dir_path/perl_dir/lib/perl5/man/man

Hopefully this will work if the previous line doesn't.  Once you get
it working, don't forget to set your PERL5LIB environment variable to
/home_dir_path/perl_dir .
=================================

   That's it for now.  These notes were useful for me, so that's why I
included them here.

   Have a good day!

   -- Jean-Luc Romano


------------------------------

Date: 18 Aug 2004 15:03:29 -0700
From: toddh@lucent.com (Todd Hlavacek)
Subject: Mysql->Connect and Ports
Message-Id: <8abf1b57.0408181323.4a18bc0b@posting.google.com>

Hello all,

A quick question to the community.  I'm trying to figure out how to
use the Mysql->connect with multiple databases.  Somewhere in Google,
some guy said "RTFM perldoc DBD/mysql".  I did and that documentation
does not have info on accessing multiple mysql databases on different
ports.

I was wondering that since there is no mention of support for multiple
mysql database instances in the Mysql module, I wonder if we fall back
to DBI->connect... with the port in the arguments passed to the
connect parameter?

Just wondering...
Thanks,
Todd


------------------------------

Date: 18 Aug 2004 11:57:51 -0700
From: icari.eccles@gmail.com (Icari)
Subject: Net::SFTP ssh_args => [ ] syntax question...
Message-Id: <e0097116.0408181057.2c042d65@posting.google.com>

I am fairly new to Perl this being my first scripting project so I'm
still in my 'baby-talk' stage, but any suggestions/input would be most
helpful!

There's an example psftp script in the Net::SFTP module directory
which defines the following argument hash to pass into sftp:

my %args = (ssh_args => []);  # from the perl man pages, it looks like
                              # ssh_args can be any arguments
                              # accepted by Net::SSH, so I guess
                              # I can put a hash list within
                              # a hash?

I wasn't able to run that script cleanly to test if my Net::SFTP
module was installed correctly so I wrote a smaller script to test:

#!/usr/local/bin/perl
use strict;

use Net::SFTP;

<$host, $user and $pass definined here>
my %args = (user => "$user", password => "$pass");
my $sftp = Net::SFTP->new($host, %args);
$sftp->put("testfile", "/var/tmp/remotetest");

When I ran my transfer program, it exits with a complaint that it does
not know what port 'ssh' is and made reference to the Net::SSH::Perl
pm file...

I added ssh port 22 in my /etc/services file to temporarily fix this,
but I am really curious as to how I can define the ssh port within my
argument hash?

my %args = (user => "$user", password => "$pass", ssh_args => [port =>
22]);

Is the above right?  I don't see the [ ] signs used too often outside
of pattern class definitions, the only time I saw this was with slices
so I'm not sure what the correct way to input additional ssh arguments
into the ssh_args option.

Thanks,
Icari.


------------------------------

Date: 18 Aug 2004 08:50:24 -0700
From: chrischandler25@hotmail.com (Chris Chandler)
Subject: Non match word list with Regular Expressions
Message-Id: <954bba38.0408180750.231b1f25@posting.google.com>

Hello

Is it possible to include a list of words NOT to match in a regular
expression?

I have used a simple expression such as:

</?(table|tbody|thead|tr|td).*?>

to match any of these html tags (or closing tags).  

Is it possible to do the reverse and specify a list of terms NOT to be
matched, ie. Don't match <b> or <ul> tags but match all others?

Regards
Chris Chandler


------------------------------

Date: 18 Aug 2004 18:27:21 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: Non match word list with Regular Expressions
Message-Id: <Xns954988E17A409castleamber@130.133.1.4>

chrischandler25@hotmail.com (Chris Chandler) wrote in 
news:954bba38.0408180750.231b1f25@posting.google.com:

> Hello
> 
> Is it possible to include a list of words NOT to match in a regular
> expression?
> 
> I have used a simple expression such as:
> 
> </?(table|tbody|thead|tr|td).*?>
> 
> to match any of these html tags (or closing tags).  
> 
> Is it possible to do the reverse and specify a list of terms NOT to be
> matched, ie. Don't match <b> or <ul> tags but match all others?

Use an HTML parser for HTML.

-- 
John                    Small Perl scripts:http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


------------------------------

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 V10 Issue 6880
***************************************


home help back first fref pref prev next nref lref last post