$VAR1 = { 'class_name' => '1st level Fighter/1st level Thief/1st level Mage', 'intelligence' => '18', 'wisdom' => '14', 'charisma' => '15', 'experience' => '0', 'dexterity' => '18', 'strength' => '18(93)', 'last_name' => 'Zendelic', 'generic_class_name' => 'Fighter-Thief-Mage', 'filename' => '!ZeKy', 'generic_race' => 'Half-Elf', 'constitution' => '17', 'race' => 'Half-Elf', 'alignment' => 'Neutral Good', 'gender' => 'Female', 'id_name' => 'Kymaria_Zendelic', 'first_name' => 'Kymaria' }; #### while (defined (my $hr = $csv->getline_hr($io))) { # use $hr->{id_name} to get the id_name } #### while (defined (my $hr = $csv->getline_hr($io))) { my %general_information = ( "class(es)" => $hr->{class_name}, alignment => $hr->{alignment}, race => $hr->{race}, gender => $hr->{gender}, ); my %ability_scores = ( strength => $hr->{strength}, dexterity => $hr->{dexterity}, constitution => $hr->{constitution}, intelligence => $hr->{intelligence}, wisdom => $hr->{wisdom}, charisma => $hr->{charisma}, ); # do stuff with the above hashes. } #### while (defined (my $hr = $csv->getline_hr($io))) { my %general_information = ( "class(es)" => $hr->{class_name}, map { $_ => $hr->{$_} } qw/alignment race gender/; ); my %ability_scores = ( map { $_ => $hr->{$_} } qw/strength dexterity constitution intelligence wisdom charisma/ ); # here you can use them, same as previous example. list_loop(\%general_information); list_loop(\%ability_scores); }