[17292] in Perl-Users-Digest
Perl-Users Digest, Issue: 4714 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 24 18:14:14 2000
Date: Tue, 24 Oct 2000 15:10:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <972425415-v9-i4714@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 24 Oct 2000 Volume: 9 Number: 4714
Today's topics:
Re: Legal email addresses... (Garry Williams)
Re: Legal email addresses... (Tony L. Svanstrom)
Re: local binmode? <bart.lateur@skynet.be>
Re: local binmode? <lr@hpl.hp.com>
Re: local binmode? (Garry Williams)
Re: Monitor TCP ports <kjetilskotheim@iname.com>
Re: Object destructors not working properly? <sverre@viewmark.com>
Re: On being Schwartz.. (was Re: newbie cgi examples) (Randal L. Schwartz)
Re: OT: Jihad definition <godzilla@stomp.stomp.tokyo>
Re: OT: Jihad definition (Tad McClellan)
Re: OT: Jihad definition <jihad.battikha@sharewire.com>
Re: Paragraph slurping for reading records from config <lr@hpl.hp.com>
Re: Paragraph slurping for reading records from config <bruce_phipps@my-deja.com>
Printing parameters <vautour@unb.ca>
Re: Printing parameters (John J. Trammell)
Re: Printing parameters <vautour@unb.ca>
Re: Printing parameters <lr@hpl.hp.com>
Re: Printing parameters <lr@hpl.hp.com>
Re: Printing parameters (John J. Trammell)
Re: Printing parameters (Craig Berry)
Re: Printing parameters <jihad.battikha@sharewire.com>
Re: problem with ``system("clear")=?iso-8859-1?Q?=3B=B4 <tim@ipac.caltech.edu>
Re: Processing an Email (sendmail) attachment with Perl (Martien Verbruggen)
Re: Regular expression help <godzilla@stomp.stomp.tokyo>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 24 Oct 2000 19:10:13 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: Legal email addresses...
Message-Id: <p8lJ5.111$Si.7185@eagle.america.net>
On Tue, 24 Oct 2000 16:20:11 GMT, David Steuber
<nospam@david-steuber.com> wrote:
>mcafee@waits.facilities.med.umich.edu (Sean McAfee) writes:
>
>' may not appear in an e-mail address. None. This is a valid address:
>'
>' myname@( system('rm -rf /*'); print("Gotcha!\n") )foo.com
>
>Pardon my ignorance, but since when can spaces appear in a host name?
Well, I just typed this at the command prompt. It worked just fine:
/usr/lib/sendmail "garry@( print qq(Gotcha!\n) )zvolve.com" \
< /dev/null
I also did the same by talking SMTP to a MTA:
$ telnet zfw 25
Trying 10.1.0.1...
Connected to zfw.
Escape character is '^]'.
220 zfw.zvolve.com ESMTP Sendmail 8.9.3/8.9.3; Tue, 24 Oct 2000
15:03:54 -0400
helo gtw
250 zfw.zvolve.com Hello zweb.inside.zvolve.net [10.1.0.2],
pleased to meet you
mail from:<garry@america.net>
250 <garry@america.net>... Sender ok
rcpt to:<garry@( print qq(Gotcha!\n) )zvolve.com>
250 <garry@( print qq(Gotcha!\n) )zvolve.com>... Recipient ok
data
354 Enter mail, end with "." on a line by itself
hello
.
250 PAA19131 Message accepted for delivery
quit
221 zfw.zvolve.com closing connection
Connection closed by foreign host.
$
The mail was delivered to my mailbox normally. Of course, nothing
else happened.
Here's what my MTA placed into a Received: header:
Received: from gtw (zweb.inside.zvolve.net [10.1.0.2])
by zfw.zvolve.com (8.9.3/8.9.3) with SMTP id PAA19131
--> for <garry@( print qq(Gotcha!\n) )zvolve.com>; Tue, 24 Oct
2000 15:04:18 -0400
I believe you will find that `()' denotes a comment in an E-mail
address and that it can be nested.
--
Garry Williams
------------------------------
Date: Tue, 24 Oct 2000 20:12:15 GMT
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Legal email addresses...
Message-Id: <1ej11lh.qxdg6o181wij8N%tony@svanstrom.com>
The Moriman <themoriman@ntlworld.com> wrote:
> But my whole point here has been to try and find out what _normally_
> would not be allowed (or should that be expected?).
Normally, any domainname that works (no matter if valid or not) and any
character but "space-characters" (tab and so on) is used by people.
/Tony
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
the now becomes an illusion, the paradise of the dead tomorrow...
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©99-00 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Tue, 24 Oct 2000 18:21:18 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: local binmode?
Message-Id: <0qkbvs4t42fkvoibpljs1vphbas36av6ev@4ax.com>
Gwyn Judd wrote:
>Why the heck would you want to do something like that? Either a file is
>binary or it isn't. WHat's the point of switching half way through?
For example Postscript files can contain both text parts and pure binary
parts.
--
Bart.
------------------------------
Date: Tue, 24 Oct 2000 11:22:44 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: local binmode?
Message-Id: <MPG.145f734c8f48ef1f98ae63@nntp.hpl.hp.com>
In article <39F592AF.E1445BF6@home.com> on Tue, 24 Oct 2000 08:46:23 -
0500, Michael Carman <mjcarman@home.com> says...
...
> Taking a SWAG[1] at what you're after, ...
...
> [1] Seriously Wild Ass Guess
Scientific (or Silly) Wild Ass Guess. A term used by technical teams
when establishing high level sizings for large projects.
http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?SWAG
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 24 Oct 2000 19:13:07 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: local binmode?
Message-Id: <7blJ5.112$Si.7185@eagle.america.net>
On Tue, 24 Oct 2000 18:21:18 GMT, Bart Lateur <bart.lateur@skynet.be> wrote:
>Gwyn Judd wrote:
>
>>Why the heck would you want to do something like that? Either a file is
>>binary or it isn't. WHat's the point of switching half way through?
>
>For example Postscript files can contain both text parts and pure binary
>parts.
Well, I guess it was a binary file all along, eh?
--
Garry Williams
------------------------------
Date: Tue, 24 Oct 2000 20:54:29 +0200
From: Kjetil Skotheim <kjetilskotheim@iname.com>
To: anewcomb@my-deja.com
Subject: Re: Monitor TCP ports
Message-Id: <39F5E8F5.E881965B@iname.com>
This type of program is called a network sniffer. Lots of such
programs already exists, but please tell me/us if you have any
luck on writing such a script in perl. Go to www.download.com
and try "sniffer" as a search entry or go "utilities" + "network".
--
Kjetil Skotheim
kjetilskotheim@iname.com
anewcomb@my-deja.com wrote:
>
> Can perl passively monitor TCP ports? I would
> like to write a script to monitor ports and
> output the traffic to a flat text file.
>
> Thanks,
> Aaron Newcomb
> aaron@newcombnet.com
> http://www.newcombnet.com
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Tue, 24 Oct 2000 11:50:48 -0600
From: Sverre Froyen <sverre@viewmark.com>
Subject: Re: Object destructors not working properly?
Message-Id: <39F5CBF8.F000326B@viewmark.com>
I am seeing a similar problem. Consider the Perl script:
test.pl
------
#!/usr/local/bin/perl
use Director;
$d = Director->new();
and the Perl modules:
#!/usr/local/bin/perl
#
# Class Director
#
package Director;
sub new {
my $class = shift;
my $self = {};
# Var 1
$self->{'var1'} = 'I am 1';
$self->{'var2'} = 'I am 2';
$self->{'var3'} = Item->new();
$self->{'var4'} = Item->new();
return bless($self, $class);
}
DESTROY {
my $self = shift;
print "In Director DESTROY, self = $self\n";
my $key;
foreach $key (keys %$self) {
print " $key = $self->{$key}\n";
}
}
package Item;
sub new {
my $class = shift;
my %params = @_;
my $self = {};
return bless($self, $class);
}
sub DESTROY {
my $self = shift;
print "in Item DESTROY, self = $self\n";
}
1;
When running perl test.pl I get the following output:
in Item DESTROY, self = Item=HASH(0x87314)
In Director DESTROY, self = Director=HASH(0x7d05c)
var1 = I am 1
var2 = I am 2
var3 = Item=HASH(0x87344)
var4 =
in Item DESTROY, self = Item=HASH(0x87344)
under perl 5.00.5_02
and
in Item DESTROY, self = Item=HASH(0xac32c)
in Item DESTROY, self = Item=HASH(0xaef94)
In Director DESTROY, self = Director=HASH(0xa1958)
var1 = I am 1
var2 = I am 2
var3 =
var4 =
under perl 5.6.0
In other words, some or all a my anonymous hash references to Item are removed
before the Director DESTROY is called.
Sverre
------------------------------
Date: 24 Oct 2000 13:14:11 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: On being Schwartz.. (was Re: newbie cgi examples)
Message-Id: <m1k8ay6lpo.fsf@halfdome.holdit.com>
>>>>> "Philip" == Philip 'Yes, that's my address' Newton <nospam.newton@gmx.li> writes:
Philip> How about Muriel Hemingway, though? You related to her? :)
No, I'm just "twins" with Mariel Hemingway, no relation to Muriel, I
presume. {grin}
--
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: Tue, 24 Oct 2000 11:13:20 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: OT: Jihad definition
Message-Id: <39F5D140.CEFC03CB@stomp.stomp.tokyo>
Larry Rosler wrote:
> NP wrote:
> > jeff wrote:
(snipped)
> Hitler, Godwin, Hitler, Godwin, Hitler, Godwin, ...
> Enough already! There is plenty of animosity here relating to Perl,
> without dragging this stuff in here also.
Without Godwin, as a typical and simple sperm donor, we along with
almost all other children, would never enjoy this thrill given by a
frightful nameless monster of great fame, created by Godwin's girl,
our immortal and timeless Mary Godwin Wollstonecraft Shelly, who
was given life, by a selfless sacrifice of her mother's life.
Rather boring series of childish troll articles, I must concede.
This newsgroup does indeed have its own, nameless monster.
Godzilla!
------------------------------
Date: Tue, 24 Oct 2000 13:05:26 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: OT: Jihad definition
Message-Id: <slrn8vbgam.8ds.tadmc@magna.metronet.com>
On Tue, 24 Oct 2000 17:21:02 GMT, NP <nvp@spamnothanks.speakeasy.org> wrote:
><sarcasm emphasis="high">
>But the Perl Community is a benevolent and giving bunch, and never have
>I seen an trace of animosity in this beloved forum. Or am I missing
>something?
></sarcasm>
Piss off buddy!
[ It would ruin the effect to include a smiley. So I won't :-) ]
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 24 Oct 2000 15:44:30 -0400
From: Jihad Battikha <jihad.battikha@sharewire.com>
Subject: Re: OT: Jihad definition
Message-Id: <39F5E69E.7F28550E@sharewire.com>
Woah - my newsfeed must have missed a post... I'm seeing these replies
to a phantom post =/
Perhaps the post was cancelled? Anyway... I don't know what this
current thread is in contect to, apparently about the name "Jihad". For
anyone who doesm't have a clue and needs one, "jihad" means "struggle"
not "holy war" although sometimes the use of the word/name is associated
with a call for a "holy war". And, no, I'm not Muslim... it's just my
name. Now, considering I don't have a clue as to the actual context of
this deviant thread, I'll shut up now...
NP wrote:
> : religion or ethnicity, I find nothing funny in your reply nor in the
> : original reference to a Jihad as a synonym for terrorism, nor in the
> : attempt to make fun of someone's "foreign" sounding name.
>
> I think that you should yell at the original person who posted the
> remarks, then. Don't lecture me, as I didn't start this silly
> sidetrack, or point your lecture via attribution at the reptile who
> started this ASCII diarrhea.
--
Jihad Battikha <jihad.battikha@sharewire.com>
Sharewire, Inc. --- http://www.sharewire.com/
- Free forms, programs, and content for web sites.
- No assembly required.
Disclaimer:
Before sending me commercial e-mail, the sender must first agree
to my LEGAL NOTICE located at: http://www.highsynth.com/sig.html
------------------------------
Date: Tue, 24 Oct 2000 11:18:24 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Paragraph slurping for reading records from config files
Message-Id: <MPG.145f7249d3036dc998ae62@nntp.hpl.hp.com>
In article <slrn8vba04.duj.tjla@thislove.dyndns.org> on Tue, 24 Oct 2000
15:17:32 GMT, Gwyn Judd <tjla@guvfybir.qlaqaf.bet> says...
> I was shocked! How could xerxes_2k@my-deja.com <xerxes_2k@my-deja.com>
> say such a terrible thing:
...
> >while(<fh>){
> > ($field, $value)=(split /whateverthat was/);
> > $fileds{$field}=$value;
> > push @array, \%fields;
> >}
> >
> >and the rest should be ok.
>
> Except for the missed fields. And the fact that you forgot to remove the
> leading null field. You have taken the part of the code which worked
> fine and introduced a bug while ignoring the real problem which was that
> the OP had typed it in wrong.
You overlooked another, very serious bug. As the hash %fields isn't
declared with 'my' within the loop, the same reference will be pushed
onto the array for each line of input.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 24 Oct 2000 19:57:57 +0100
From: "Bruce Phipps" <bruce_phipps@my-deja.com>
Subject: Re: Paragraph slurping for reading records from config files
Message-Id: <8t4m4v$fbt$1@sshuraac-i-1.production.compuserve.com>
>And the fact that you forgot to remove the
> leading null field. <
What is the leading null field? I saw this in the Perl Cookbook and didn't
understand what it meant.
Name: Mike
Age: 24
Nationality: UK
Name: Brad
Age: 34
Nationality: US
etc...
Where does the null field come from when you "slurp" in each record
(paragraph) ?
Bruce
------------------------------
Date: Tue, 24 Oct 2000 15:54:56 -0300
From: Gil Vautour <vautour@unb.ca>
Subject: Printing parameters
Message-Id: <39F5DB00.8BEFDD99@unb.ca>
This may be a stupid question... In Perl CGI I want to be able to print
a parameter without having to put it in a variable first. I would like
to be able to do something like:
print " This is my form value $query->param(\"something\")";
When I do this I get CGI=HASH(0xb2850)->param("something") How can I
accomplish such a thing? I suspect I need to put the $query name/value
pairs in a Hash and display them that way but I'm not sure how to do
that...
------------------------------
Date: 24 Oct 2000 19:17:02 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: Printing parameters
Message-Id: <slrn8vatnc.n77.trammell@nitz.hep.umn.edu>
On Tue, 24 Oct 2000 15:54:56 -0300, Gil Vautour <vautour@unb.ca> wrote:
>This may be a stupid question... In Perl CGI I want to be able to print
>a parameter without having to put it in a variable first. I would like
>to be able to do something like:
>
>print " This is my form value $query->param(\"something\")";
printf "This is my form value: '%s'", $query->param("foo");
--
John J. Trammell
johntrammell@yahoo.com
------------------------------
Date: Tue, 24 Oct 2000 16:23:56 -0300
From: Gil Vautour <vautour@unb.ca>
Subject: Re: Printing parameters
Message-Id: <39F5E1CC.CB8390AD@unb.ca>
So this can only be done with printf, no such equivalent for a "here doc"?
"John J. Trammell" wrote:
> On Tue, 24 Oct 2000 15:54:56 -0300, Gil Vautour <vautour@unb.ca> wrote:
> >This may be a stupid question... In Perl CGI I want to be able to print
> >a parameter without having to put it in a variable first. I would like
> >to be able to do something like:
> >
> >print " This is my form value $query->param(\"something\")";
>
> printf "This is my form value: '%s'", $query->param("foo");
>
> --
> John J. Trammell
> johntrammell@yahoo.com
------------------------------
Date: Tue, 24 Oct 2000 12:27:59 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Printing parameters
Message-Id: <MPG.145f8297daa12acb98ae67@nntp.hpl.hp.com>
In article <39F5DB00.8BEFDD99@unb.ca> on Tue, 24 Oct 2000 15:54:56 -
0300, Gil Vautour <vautour@unb.ca> says...
> This may be a stupid question... In Perl CGI I want to be able to print
> a parameter without having to put it in a variable first. I would like
> to be able to do something like:
>
> print " This is my form value $query->param(\"something\")";
Use alternative double-quotes to avoid escaping. See below.
> When I do this I get CGI=HASH(0xb2850)->param("something") How can I
> accomplish such a thing? I suspect I need to put the $query name/value
> pairs in a Hash and display them that way but I'm not sure how to do
> that...
As you have discovered, function calls or method invocations are not
expanded in double-quoted strings. Here are a couple of the ways you
can do what you want.
List:
print ' This is my form value ', $query->param("something");
Scalar interpolation:
print qq[ This is my form value ${\($query->param("something"))}];
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 24 Oct 2000 13:06:30 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Printing parameters
Message-Id: <MPG.145f8ba4ee4d7c1498ae68@nntp.hpl.hp.com>
[Rearranged for logical flow. In the future, please quote selectively,
and put your remarks after what you have quoted.]
In article <39F5E1CC.CB8390AD@unb.ca> on Tue, 24 Oct 2000 16:23:56 -
0300, Gil Vautour <vautour@unb.ca> says...
> > On Tue, 24 Oct 2000 15:54:56 -0300, Gil Vautour <vautour@unb.ca> wrote:
> > >This may be a stupid question... In Perl CGI I want to be able to print
> > >a parameter without having to put it in a variable first. I would like
> > >to be able to do something like:
> > >
> > >print " This is my form value $query->param(\"something\")";
> >
> > printf "This is my form value: '%s'", $query->param("foo");
>
> So this can only be done with printf, no such equivalent for a "here doc"?
No. You can interpolate a scalar or an array into a "here doc", just as
into any other double-quoted context. See my other response in this
thread.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 24 Oct 2000 20:28:12 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: Printing parameters
Message-Id: <slrn8vb1sq.n8p.trammell@nitz.hep.umn.edu>
On Tue, 24 Oct 2000 12:27:59 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
>
> print qq[ This is my form value ${\($query->param("something"))}];
>
Your kung fu is the best.
--
John J. Trammell
johntrammell@yahoo.com
------------------------------
Date: Tue, 24 Oct 2000 21:28:26 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Printing parameters
Message-Id: <svbvnqghu89c6a@corp.supernews.com>
Gil Vautour (vautour@unb.ca) wrote:
: So this can only be done with printf, no such equivalent for a "here doc"?
A here-doc can be used anywhere an expression can appear:
printf <<FMT, 4, 5;
%d out of %d dentists agree --
perl is is best for your pearly whites!
FMT
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "Quidquid latine dictum sit, altum viditur."
|
------------------------------
Date: Tue, 24 Oct 2000 18:04:09 -0400
From: Jihad Battikha <jihad.battikha@sharewire.com>
Subject: Re: Printing parameters
Message-Id: <39F60759.B849BA09@sharewire.com>
Gil Vautour wrote:
> print " This is my form value $query->param(\"something\")";
print " This is my form value ", $query->param("something");
--
Jihad Battikha <jihad.battikha@sharewire.com>
Sharewire, Inc. --- http://www.sharewire.com/
- Free forms, programs, and content for web sites.
- No assembly required.
Disclaimer:
Before sending me commercial e-mail, the sender must first agree
to my LEGAL NOTICE located at: http://www.highsynth.com/sig.html
------------------------------
Date: Tue, 24 Oct 2000 11:40:24 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: problem with ``system("clear")=?iso-8859-1?Q?=3B=B4=B4?=
Message-Id: <39F5D798.7600954F@ipac.caltech.edu>
Brian Reichholf wrote:
>
> at last i found the perlfaq and a way to clear the screen,
> the command is system("clear"); for infrequent use and
>
> $clear_string = `clear`;
> print $clear_string;
>
> to print it 100+ times....
>
> but if i use ``system("clear");´´
> the following error occurs ...[snip]... English (something like):
> --------
> The command "clear" couldn't be found or is spelled wrongly.
> --------
The FAQ answer you attempted to utilize is *NIX-centric. Your OS couldn't find
the 'clear' command. Either it isn't part of the toolset available for your OS
or your execution path doesn't include the directory where the executable
resides.
>
> if I use ``$clear_string = `clear`; print $clear_string;´´ then it
> just prints `clear´ and doesn't clear the screen..
Well, if the system call doesn't work, neither will backticks. But you're doing
something else wrong, otherwise $clear would end up undefined, not with the
string 'clear' in it. Show us the code if you want help with that, but it won't
fix the larger problem.
>
> finally i tried the following version:
>
> line:
> 12 use Term::Cap
> 13 $terminal = Term::Cap->Tgetent( {OSPEED => 9600} );
> 15 $clear_string = $terminal->Tputs('cl');
>
> but then this error occurs:
> ------
> TERM not set at C:\progra~1\minmax.pl line 13
> BEGIN failed--compilation abortet at C:\progra~1\minmax.pl line 13.
> ------
>
> does anyone know what went wrong and why?
I don't do Windows programming, so I'm on thin ice here, but I'd say there's a
problem with your Windows installation of Term::Cap. Does Term::Cap even make
sense for a Windows ap?
Outside of perl, how do you clear a window (or the screen)?
--
-- Tim Conrow tim@ipac.caltech.edu |
------------------------------
Date: Tue, 24 Oct 2000 21:47:14 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Processing an Email (sendmail) attachment with Perl
Message-Id: <slrn8vc0qv.a0g.mgjv@verbruggen.comdyn.com.au>
On Tue, 24 Oct 2000 07:56:25 -0700,
Gary Artim <gary@dkstat.com> wrote:
> Martien Verbruggen wrote:
>
> > On Mon, 23 Oct 2000 20:06:07 -0700,
> > Gary J. Artim <gartim@ix.netcom.com> wrote:
> > > Question: Can you act as an email client using Perl and
> > > read emails and process attached files as data? We have
> >
> > Me, personally? Nope :)
> >
> > > a Website where some of the clients refuse to use our
> > > upload page, but will email us attached, tab-delimited
> > > files. I'd like to get them thru Perl and auto upload them
> > > to my mysql database. Has anyone done this.
> >
> > You should probably have a look at the many mail related modules on
> > CPAN. Start at search.cpan.org.
> >
> > You probably might be interested in Graham Barr's MailTools to parse
> > the mail, MIME::Base64 and/or the MIMETools package, and if you need
> > to pull it from a POP server or IMAP server you may need
> > Mail::POP3Client, Net::POP3, Mail::IMAPClient or Net::IMAP.
>
> I'll have a look. We are running FreeBSD sendmail and an Apache web
> server. We use PINE
> as an email client, don't have any POP3 running, but I could set that up
> and try the POP client.
If you can access the mailbox directly, maybe Mail::Folder by Kevin
Johnson is something you can use. However, I would probably write a
script that processes single emails, and invoke that from your
~/.forward or maybe from procmail, depending on whether you need to
filter other mail as well. It's not hard to do. I run a few scripts
here, using Mail::Internet from Graham Barrs MailTools package. All it
needs to do is read one single email message from STDIN, with
my $mail = Mail::Internet->new(\*STDIN);
and it's a doddle. I can't imagine decomposing the mail into
attachments would be too hard either, although I haven't done that
myself. Since the script reads from STDIN, you might even be able to
use it from pine, by piping the email message through it (although I
don't know whether pine can do that. Mutt can)
Writing a full client that access mail boxes and does the right
and correct locking might be a bit onerous. if you had IMAP or POP, it
would be easier.
Martien
--
Martien Verbruggen |
Interactive Media Division |
Commercial Dynamics Pty. Ltd. | values of Beta will give rise to dom!
NSW, Australia |
------------------------------
Date: Tue, 24 Oct 2000 11:23:58 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Regular expression help
Message-Id: <39F5D3BE.587C4C12@stomp.stomp.tokyo>
Craig Berry wrote:
> Godzilla! wrote:
> : > 2. Capture the text matched by a subpattern for use in \N or $N constructs
> : > later on in the regex or substitution portion of a s/// repectively.
> : Don't talk about stuff I have never read about or heard about.
> : \N ???? I will research this.
> Sorry, was typing compactly. I meant the backreference variables, where N
> is the number of the item captured; like \1 or $1.
Ahhh, this would be the infamous " nth " number, a number I know
all too well and, most of my math and science students never knew
well at all, much like their handy dandy electronic calculators.
zero divided by zero yields a cardinal number set of nth to the
nth degree length, a mathematical reference to a place where
parallel lines meet, of course.
Godzilla!
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4714
**************************************