Könnte so gehen (ohne Gewähr):
my $attac = {};
for(my $i = 1; $i <= 10; $i++) {
$attac->{ $imgfiles[$i] } = {'_disptype'=>'GIF Image','_inline'=>$imgfiles[$i],'description'=>'ATM-Image','ctype'=>'image/gif','file'=>$imgdirfiles,},
} #for
email({
'from' => 'test@test.com',
'to' => 'test@test.com',
'subject' => $mail_subject,
'smtp' => $mailserver,
'_text' => 'Sorry, your e-mail client is not supporting html mails.',
'_html' => $mail_message,
'_attachments' => $attac,
}) or die "email() failed: $@";