in reply to Array of Hashes

Thank you all. The -> notation is great, and as a c programmer, makes me feel at home. I've turned strict on and it now works. Unfortunately, I am currently blind because some modrewrite in some .htaccess file is preventing me from seeing debug info.

Perhaps you can tell me why, using the -> notation, keys do not go in quotes? In the following, what is the type of mykey? It doesn't have quotes, nor a type prefix such as $, %, or @.

$myhash_ref->{mykey};

Replies are listed 'Best First'.
Re^2: Array of Hashes
by Anonymous Monk on Oct 28, 2011 at 19:30 UTC

    why, using the -> notation, keys do not go in quotes?

    They do -- the quotes are just optional. You might need the quotes if the key name collides with a built-in function such as 'shift'

    In the following, what is the type of mykey? $myhash_ref->{mykey};

    That would be equal to the string 'mykey'

      Thanks vroom. I will be explicit then and use the quotes.