my $i = 0; foreach $u (@users) { $adds{$u} = qx(ls /home/$exusers[$i]/.bash_profile); $i++; }