>perl -wMstrict -le "sub S { print 'hi ', $_[0] } sub T { print 'lo ', $_[0] } sub U { print '-- ', $_[0] } my %hash = ( my $x = L => \&S, my $y = M => \&T, my $z = N => \&U, ); print $x; $hash{$x}->($x); $hash{L} ->('L'); $hash{$_}->($_) for qw(L M N); " L hi L hi L hi L lo M -- N