# use the whole array for (@{ $bin_file_data{$sampname} }){ ... } # get a single element my $thing = $bin_file_data{$sampname}->[0];