On Sat, Jan 17, 2009 at 06:08:56AM +0000, Phil White said: > A summary of the code is given below. What I need to be able to do, is > create a new multipart container, and attach this to the aforementioned > anonymous hash - it is this part that I am failing on...
>From the docs attach PART Instance method. Add a new part to this message, and return the new part. If you supply a single PART argument, it will be regarded as a MIME::Lite object to be attached. So you should just be able to push @{ $msg->{attach} }, $piece; and then change send() to say foreach my $a (@{ $msg->{attach} || [] }) { $ml->attach( ('HASH' eq ref($a))? %$a : $a ); }