Forum Moderators: coopster & phranque

Message Too Old, No Replies

Retrieve data from piped email

Problems getting content of email in perl

         

Duncs

12:00 pm on Dec 12, 2003 (gmt 0)

10+ Year Member



Hey

I use procmail to pipe an email to a perl script. At the moment i am using this to retrieve the data in the email:

$input = $_ ;

However when i print the $input out to a file, all i get is the first line of the email, i.e. the subject line.

I thought this might be to do with the fact that i need to use @input to get an array. That doesn't help though.

Any ideas? Am i reading in the email right? The perl script is just called by procmail as it pipes the email.

I've searched the web and tried a few things, mainly based around <stdin> as well, but can't get them to work!

Any help is much appreciated!

Duncs

moltar

5:07 pm on Dec 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try:

local (*STDIN, $/, $_);

Duncs

9:43 am on Dec 15, 2003 (gmt 0)

10+ Year Member



Thanks Moltar,

Tried that and it did the trick!

Much obliged,

Duncs