in reply to filename of an attachment

$Type contains the splitted result of field->mime_type. You are however splitting at the character '/' therefore it is impossible that $Type contains the pattern 'multipart/mixed'. If $field->mimetype returns 'multipart/mixed' then $Type will contain 'multipart' and $subtype will contain 'mixed'.
Update:

looking at the code i was also confused by the way you created your fields 'object'. You just assign the string 'Content-Type' to a variable called $field and rely on perl symbol table voodoo to dereference it to MIME::Field::ContType. I recommend that you have a look at the syntax used in the example of MIME::Field::ContType. It might help you getting closer to a solution.

Another problem is: assuming the desired information is contained in the $header - you aren't accessing it anywhere.

If you want to have a look at some working examples you might try searching google for o'reillys perl cookbook. It contains complete example scripts which might help you solve common problems.

Replies are listed 'Best First'.
Re^2: filename of an attachment
by Bass-Fighter (Beadle) on Dec 08, 2008 at 14:00 UTC
    yes, you right, but now I have the problem that my program freezes somewhere between the stdin and the print, do you know the solution for that too?
Re^2: filename of an attachment
by Bass-Fighter (Beadle) on Dec 08, 2008 at 14:31 UTC
    ok thx i will do that, I hope I can find something