in reply to pass by reference

hm, i would suggest to do something like
&capitalise( \%horoscopes ); sub capitalise { my $values = shift; foreach ( keys ( %{$values} ) ) { .... ...this is not tested...
because i think you want to give your sub a reference on the hash %horoscopes. but what you actualy did is to store a reference in $reference and give it to the sub but you used the scalar reference from the main program.
you should not only read the reftut again but read perlsub too.