in reply to pass by reference

bivouac,
Your problem isn't with the concept of references, it is with the hash itself. Have you tried running the code without the sub? It will not change the case of the keys.
#!/usr/bin/perl -w use strict; my %horoscopes = ( 'homer' => 'pisces', 'marge' => 'sagitarius', 'bart' => 'cancer', 'libra' => 'libra' ); capitalize(\%horoscopes); sub capitalize { my $hash = shift; for my $key (keys %{$hash}) { $hash->{uc $key} = $hash->{$key}; delete $hash->{$key}; } }
The problem is you haven't defined what you want to happen if an uppercase key by the same name already exists.

Cheers - L~R