in reply to Cant use string(_) as array ref..!!
Let's analyze it. @a is an array of strings. Next, you iterate over it with
So, $key is a string, "Mon" in the first iteration. Then, you use the expressionforeach $key (@a)
It tries to dereference $key as an array reference, but it is not: it is a scalar string. Hence the error.${$key}[0]
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
In Section
Seekers of Perl Wisdom