sub another_way { ... return (val1 => $val1, val2 => $val2); } my %hash = another_way(); print "$hash{val1} $hash{val2}\n";