http://www.perlmonks.org?node_id=1015111


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
foreach $key (@a)
So, $key is a string, "Mon" in the first iteration. Then, you use the expression
${$key}[0]
It tries to dereference $key as an array reference, but it is not: it is a scalar string. Hence the error.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ