Since you are assigning to a list/hash, the first argument absorbs it all.
my %h1 = ( key => value );
my @a1 = (1, 2 );
my ( @a2, %h2 ) = ( @a1, %h1 );
# @a2 now contains (1,2,key,value) and %h2 is undefined.
To obtain what you want, you should pass references instead.
ConnectODBC( \%settings , \@connectionString);
sub ConnectODBC {
my ( $setting_ref, $connection_ref ) = @_;
my %settings = %$setting_ref;
my @connectionString = @$connection_ref;
}
I should note that making hashes and arrays out of the references in the subroutine probably is unnecessary. You can access the settings directly from the reference. $setting_ref->{key} is the same as $settings{key}.