$hash{'nodes'} = { "test_one" => [ "state_one", "foo", "bar" ], "test_two" => [ "state_two", "phu", "bah" ] }; foreach $nodekey ( keys %{$hash{'nodes'}} ) { $checkstate = $hash{'nodes'}{$nodekey}[0]; print "state of $nodekey = $checkstate\n"; }