Re: How can I read an email with perl ?

Bill Mills-Curran (bcurran@clariion.com)
Tue, 21 Sep 1999 15:34:05 -0400 (EDT)


I think I spotted a typo -- you set the variable "$lin", but you print
the variable "$linha".

Bill

On Tue, 21 Sep 1999 guy@shn.com.br wrote:

> Date: Tue, 21 Sep 99 15:50:11 +0000
> From: guy@shn.com.br
> To: libwww-perl@ics.uci.edu
> Subject: How can I read an email with perl ?
> 
> 
> 
> Hi !
> I'm trying to execute a perl script when an email arrives. I'm using RedHat 
> linux and Sendmail.
> This is my aliases:
> as400: root,"|perl /home/guy/p1.pl"
> The script p1.pl:
> #!/usr/bin/perl
> $outfile="teste.log";
> open OUT,">$outfile";
> $lin = "testing\n";
> print OUT $linha;
> 
> The program is executing when I send an email to as400. I know this because when 
> I change 
> "open OUT" by "opennn OUT" I received error messages.
> When I run the script manually the file teste.log is generated, but not when I 
> send mail to as400.
> 
> What happening ?
> How can I get the email text in the perl script ?
> Can I access a postgresql data base with perl ?
> 
> Thanks.
> 
> Curitiba -
> Brazil.
> 
> 
>