Could you please explain why the following does NOT work
my ($href_hash, $aref_array) = return_hash_and_array()
|| die "ERROR: blah";
But this works
my ($href_hash, $aref_array) = return_hash_and_array()
or die "ERROR: blah";
When using this sub
sub return_hash_and_array{
my %hash = ('key_1' => "value_1", 'key_2' => 'value_2');
my @array = ("item", "item2");
if (@array > 0){
return(\%hash, \@array);
}else{
return;
}
}
I would expect both do the same thing.