map & MIME::Parser

H

hobbzilla

What is the equivelent of this code?

map ({$_->bodyhandle->path() } @parts))


It appears to be returning something like this /tmp/path/filename.txt/
tmp/path/filename2.txt/tmp/path/filename3.txt - I really need it to
send /tmp/path/filename2.txt /tmp/path/filename3.txt (so long as /tmp/
path/filename.txt is the email body of the message -- I want the body
discarded and just need the attachments..

Please advise.

The original script I am referencing is located here:
http://people.ifax.com/~aidan/hylafax/mail2fax/mail2fax.pl.txt
 
J

J. Gleixner

hobbzilla said:
What is the equivelent of this code?

map ({$_->bodyhandle->path() } @parts))

for my $obj ( @parts )
{
$obj->bodyhandle->path();
}


perldoc -f map
It appears to be returning something like this /tmp/path/filename.txt/
tmp/path/filename2.txt/tmp/path/filename3.txt - I really need it to
send /tmp/path/filename2.txt /tmp/path/filename3.txt (so long as /tmp/
path/filename.txt is the email body of the message -- I want the body
discarded and just need the attachments..

Please advise.

The original script I am referencing is located here:
http://people.ifax.com/~aidan/hylafax/mail2fax/mail2fax.pl.txt

It's probably easiest to filter @parts first, to the ones you're
interested in, in the while() loop, by only pushing certain
ones to @parts.

For the various methods you can call:

perldoc MIME::parser
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top