use strict; use warnings; my $added = [ { link => "/var/www/docs", name => "mydocs", }, { link => "/var/www/read", name => "letters", } ]; my @keys = qw( link name ); my $success; foreach my $send_to(@send) { $success = sent( { to => 'send_to', account => 'to_account', name => 'name', subject => 'subject', title => 'title', for my $hash (@$added) { for my $key (@keys) { $key => $hash->{$key}, } } type => 'docs', }); }