Just for the sake of clarifying the origin of the incomprehension, the OP finally stated on a cross post on Perl Gurus (
http://perlguru.com/gforum.cgi?post=79335;sb=post_latest_reply;so=ASC;forum_view=forum_view_collapsed;;page=unread#unread) that he actually wanted to sort the hash alphabetically
by the keys, not by the values, so that this would be the right correction for the sorting statement:
my @keys = sort keys %functions;
Actually, the whole code could be reduced to something as simple as this:
my $info = "out.txt";
open my $out,">", $info or die "could not open $info $!";
print $out "Key: $_ and Value: $functions{$_}\n" for sort keys %functi
+ons;
close $out;