my @CONNECTCOMMANDS; for my $host (@nodes) { push @CONNECTCOMMANDS, "$SSHCOMMAND -ssh $host->{username}\@$host -pw $host->{password}"; }