# I'd like to have a system that would allow me
# to add as many images as possible to my template file here
# instead of multiple hashes, is that possible?
my %img_in;
...
my %img_sec;
...
####
my @imgs = (
{
Type => 'image/gif',
ID => 'logo',
Path => '/images/logo.gif',
Filename => 'logo.gif',
Disposition => 'attachment',
},
{
Type => 'image/gif',
ID => 'footer',
Path => '/images/footer.gif',
Filename => 'footer.gif',
Disposition => 'attachment',
},
# ...
);
####
for my $img (@imgs ) {
$msg->attach( %$img ) or die "Error adding $img->{Filename}: $!\n";
}