Hi, So what I am trying to do is print the values from a hash based on user input. So the user input needs to match the key in order to print the associated value. so I was thinking it would go something like this:
I looking for others ways to approach this, any input would be a lot of help thanks!use strict; use warnings; my %words = ('hello' => 'world'); print 'type a word: ' chomp(my $inData = <>); if($inData eq (keys %words){ print 'value: ', values %words; }
In reply to Getting values from a Hash from user input by blueblue
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |