in reply to pass by reference

Your treatment of references here is completely correct. The problem with the code is that sub capitalize does not actually change anything in the hash passed to it, as well as having argument passing problems. If you want to change the keys of the hash, try this,

sub capitalize { my $hashref = shift; foreach ( keys %$hashref ) { $hashref->{ uc($_) } = delete $hashref->{$_}; } 1; }
delete returns the value of the deleted item. That idiom is the way to rekey a hash.

After Compline,
Zaxo