# want array element - use square brackets $value = $$arrayref[2]; # want hash element - use curly brackets $othervalue = $$hashref{key2};