my %data; while () { my ($key, $value) = eval $_ or die; $data{$key} = $value; } print $data{other_key}->[1]; # data __DATA__ some_key => { data => 'structure', number => 1 } other_key => [ qw/ other data structure / ] third_key => "and a simple third"