in reply to Selecting a specific hash key to find a value
Your $a=<STDIN> leaves $a containing for instance "5\n", that is, including the newline.
If you just chomp($a) your code would work. Unless there were trailing spaces or stuff ...
Better to use $a+=0; to make it numeric.
Oh, and as the monks are sure to be telling you: You should not use $a outside of sort, since that is a special variable there.
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
|
|---|