Return a hash table from a sub routine

hello,

i am new to scripting and would like to know how to return a hash table from a sub routine.
i tried the following,

my %hash_function = ();
hash_function = &return_hash();
sub return_hash
{
    my %hash = ();
      ///populate the hash
    return %hash;
}

but it dosent seem to work. Anything wrong in this??

return the reference

 
$ cat b.pl
#!/usr/bin/perl
use strict;
use warnings;
sub get_hashes();
# Get two variables back
my ($one) = get_hashes();
print "Hash Keys : ";
print "$_ " foreach keys %$one;
print "\n";
sub get_hashes() {
        my %hash1 = (
                "1a" => "b",
                "1b" => "d"
        );
        return (\%hash1);
}
 
$ perl b.pl
Hash Keys : 1b 1a