sub test { my $scalar1 = shift; my $array2_ref = shift; my $hash3_ref = shift; ### if you want to work with the hash, and not just ### the hash reference, then dereference the ref. my %hash3 = %$hash3_ref; print "value for hash key 'one' is $hash3{'one'}\n"; ### I prefer to just use the reference instead, and ### not create the hash by dereferencing the hash ref. print "value for hash key 'one' is $hash3_ref->{'one'}\n"; return($scalar1, $array2_ref, $hash3_ref); } my $test_scalar = "abc"; my @test_array = ( "a", "b", "c" ); my %test_hash = ( "a" => 1, "b" => 2, "c" => 3 ); ($new_scalar, $new_arrayref, $new_hashref) = test($test_scalar, \@test_array, \%test_hash);