Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > map & MIME::Parser

Reply
Thread Tools

map & MIME::Parser

 
 
hobbzilla
Guest
Posts: n/a
 
      08-01-2007
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/hylafa...ail2fax.pl.txt

 
Reply With Quote
 
 
 
 
J. Gleixner
Guest
Posts: n/a
 
      08-02-2007
hobbzilla wrote:
> 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/hylafa...ail2fax.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:arser


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
std::map::find() throws exception when map is empty? Matthias Hildebrand C++ 5 03-20-2012 06:09 AM
I can map all files (.*) to asp.net worker.How do I map NO FILE to asp.net worker? alex ASP .Net 1 02-04-2005 03:18 AM
searching keys in std::map using map::upper_bound Erik Arner C++ 0 11-02-2004 11:14 PM
map.insert(key,val) vs. map[key]=val ? Patrick Guio C++ 6 10-20-2004 01:54 PM
map that maps to iterators in the same map ? Vlad C++ 0 12-15-2003 08:29 PM



Advertisments