in reply to extraction of data
If you were to attempt to do this manually, what would be the steps?
- Read the data source into a data structure using the name as an index (see associative arrays in perldoc perldata)
- Ask for partial name chomp(my $name=<STDIN>);
- Perform a case insensitive partial match of the name against the index (see perlre)
- Iterate through the indices of the associative array printing out any that match the test above see perlsyn (foreach) and also the keys operator of associative arrays
So put up the code you wrote and we'll try and hack it into shape, providing you with a complete solution is not helping you in the longer term.
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
In Section
Seekers of Perl Wisdom