Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Cant use string(_) as array ref..!!

by choroba (Canon)
on Jan 24, 2013 at 09:17 UTC ( #1015111=note: print w/ replies, xml ) Need Help??


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.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Cant use string(_) as array ref..!!
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015111]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (17)
As of 2015-07-31 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (278 votes), past polls