in reply to Cant use string(_) as array ref..!!
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]
|
|---|