Strings with code points over 0xFF may not be mapped into in-memory file handles readline() on closed filehandle $h at /usr/lib/perl5/site_perl/5.22/i686-cygwin-threads-64int/Text/CSV_XS.pm line 830. #### #! /usr/bin/env perl # Read the export from Thumbs Plus including keywords from filename given. use warnings; use strict; use utf8; # so literals and identifiers can be in UTF-8 use v5.12; # or later to get "unicode_strings" feature use warnings qw(FATAL utf8); # fatalize encoding glitches #use open qw(:std :utf8); # undeclared streams in UTF-8 #use charnames qw(:full :short); # unneeded in v5.16 use Text::CSV; use Data::Dumper; # debug my $csv = Text::CSV->new ( { binary => 1 } ) or die "Cannot use CSV in: ".Text::CSV->error_diag(); print $ARGV[0],"\n"; open my $ifh, "<:encoding(UTF-8)", $ARGV[0] or die "$ARGV[0]: $!"; print "Point a\n"; # Returns "the instance" -- of what? Do I care? my $thingie = $csv->header ($ifh); print "Point b\n"; print Dumper($csv), "\n"; #### $ head -3 /cygdrive/p/Photos/ThumbsPlus/Thumbs.txt "Volume.label","Volume.serialno","Volume.vtype","Volume.netname","Volume.filesystem","Path.name",,"Thumbnail.checksum","Thumbnail.width","Thumbnail.height","Thumbnail.horiz_res","Thumbnail.vert_res","Thumbnail.colortype","Thumbnail.colordepth","Thumbnail.gamma","Thumbnail.thumbnail_width","Thumbnail.thumbnail_height","Thumbnail.thumbnail_type","Thumbnail.thumbnail_size","Thumbnail.name","Thumbnail.metric1","Keywords.pkeywords", PCD0138,,4037894171,5,\\ddb\r$,CDFS,PHOTO_CD\IMAGES,1,0,0,"1996-09-30T21:38:57","2002-10-12T00:29:25",3368960,2147483648,512,768,0,0,0,24,0,68,100,518,336,IMG0002.PCD,m000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,b00000000000000000000000000000000,,0,";", PCD0138,,4037894171,5,\\ddb\r$,CDFS,PHOTO_CD\IMAGES,1,0,0,"1996-09-30T21:38:57","2002-10-12T00:29:25",3354624,2147483648,512,768,0,0,0,24,0,68,100,518,336,IMG0003.PCD,m000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,b00000000000000000000000000000000,,0,";",