Crystal Skull|Stargate SG-1, Crystal Skull;The Librarian: Return to King Soloman's Mines;Indiana Jones and the Kingdom of the Crystal Skull Spear of Destiny|The Librarian: Quest for the Spear;Hellboy;Constantine Book or Key of Soloman|The Librarian: Return to King Soloman's Mines;Season of the Witch Necronomicon|H.P. Lovecraft #### #!/usr/bin/perl use strict; use warnings; use Text::CSV_XS qw(csv); my $file = '/home/me/Documents/www/files/data/Miscellany/Magic_items.txt'; open(my $fh, '<', $file) || die "Can't open $file $!"; my $list = csv ( in => $file, sep_char => '|', headers => ['item', 'seen in'], key => ['item'], ); use Data::Dumper; print Dumper $list; #### Use of uninitialized value in anonymous hash ({}) at /home/me/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/Text/CSV_XS.pm line 1223, <$fh> line 4. Use of uninitialized value in anonymous hash ({}) at /home/me/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/Text/CSV_XS.pm line 1223, <$fh> line 4. Use of uninitialized value in anonymous hash ({}) at /home/me/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/Text/CSV_XS.pm line 1223, <$fh> line 4. Use of uninitialized value in anonymous hash ({}) at /home/me/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/Text/CSV_XS.pm line 1223, <$fh> line 4. $VAR1 = { '' => { 'seen in' => 'H.P. Lovecraft', 'item' => 'Necronomicon' } }; #### $csv = Text::CSV_XS->new ({ sep_char => '|', quote_char => undef, blank_is_undef => 1, empty_is_undef => 1, allow_whitespace => 1, });