in reply to Counting keys in a referenced hash
This assigns the last value in the list to $test. Later, when you dereference it, treating it like a reference to a hash, you end up with an empty hash. Probably you meant to do this instead:$test = ( test1 => '1', test2 => '2', test3 => '3');
The curly braces give you a reference to a hash. This should give you the expected result.$test = { test1 => '1', test2 => '2', test3 => '3'};
|
|---|