Feb 22, 2008, 10:40 PM
Post #1 of 4
I'm fairly new with Perl and I was wondering if anyone could tell me why my code isn't working below. I'm trying to print the value when the key is entered via user input. Here's the code below:
Help with hashes
%hash = (1,'Fred' , 2, 'Flintstone', 3, 'Barney', 4, 'Rubble');
print "Number: ";
$number = <STDIN>;
When I run the program, it only gives me a blank line. I'd greatly appreciate any help. Thank you.