my @buttons; while (my $row = $csv->getline_hr($csv_fh)) { push(@buttons, $row) unless ($. == 1); } my %buttons_hash = ""; for my $button (@buttons) { my $this_item_name = ${$button}{item_name}; ${buttons_hash}{$this_item_name} = $button; } return \%buttons_hash; }