|Don't ask to ask, just ask|
Re: using hash to compare with string and print the stringby thanos1983 (Parson)
|on May 16, 2019 at 08:59 UTC||Need Help??|
Just a minor note here because you said you are doing your first steps on hashes.
I noticed that you have an array of keys and a hash below. If the hash is not manually defined you can use hash slicing and assign the keys and values in one step to avoid typing everything manually. For example see below:
Then simply as fellow Monks demonstrate to you, iterate over the keys and if the key exists print.
Here is the documentation regarding perldata/Slices. In case you want to read a bit more on how to play with them :).
BR / Thanos
Seeking for Perl wisdom...on the process of learning...not there...yet!