in reply to No <STDIN> yeilds username and password
my $found = 0 foreach my $key (keys %name_hash) { if ($key =~ m/$_/i) { print "The username is $username and the password is $p +assword, please enter another name to search\n"; $found = 1; } } if (!$found) { print "I'm sorry, there is no one here by that name, please try an +other name or type exit to end.\n" }
(there are better ways to achieve case insensitivity, but it's a start).
Another hint: your code will only store the last username and password that was entered. Do you know why?
|
|---|