I have a perl hash passed to me in %ARGS. I have to implement the functionality wherein if for a required minimum set of keys(say key1,key2,key3,key4,key5) there are multiple values in the hash then I need to get the first value and populate the hash with the minimum set of keys.
Currently I have.
while (my ($key, $value) = each(%ARGS)) {
#check if key is equal to the keys from the set.
if (ref($value) ) {
#means its a nested key value pair.
extract first value and put it for the key
How do I establish that. Any pointers would be useful
use Data::Dumper; print Dumper(\%ARGS);
to see the structure of %ARGS. Then you can show us an example in the same format. – RobEarlfor (qw(key1 key2 ...))
– TLP%ARGV
except the minimum set,key1, key2, ...
? – TLP