map & MIME::Parser

Discussion in 'Perl Misc' started by hobbzilla, Aug 1, 2007.

  1. hobbzilla

    hobbzilla Guest

    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
     
    hobbzilla, Aug 1, 2007
    #1
    1. Advertising

  2. hobbzilla

    J. Gleixner Guest

    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/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
     
    J. Gleixner, Aug 2, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CJ
    Replies:
    1
    Views:
    1,574
    Andrew Thompson
    Oct 29, 2004
  2. Jan Arickx
    Replies:
    0
    Views:
    202
    Jan Arickx
    Aug 25, 2003
  3. Chris Larsen

    Mime::Parser::Filer problemo

    Chris Larsen, Sep 10, 2003, in forum: Perl Misc
    Replies:
    0
    Views:
    105
    Chris Larsen
    Sep 10, 2003
  4. joe
    Replies:
    0
    Views:
    197
  5. ecureuil
    Replies:
    0
    Views:
    327
    ecureuil
    May 28, 2006
Loading...

Share This Page