This is very odd so I must be missing something really obvious. My test program:
#!/usr/bin/perl
use v5.10 ;
use strict;
use warnings ;
use Text::CSV ;
use FileHandle ;
my $csv = Text::CSV->new((binary => 1)) ;
my $fh = new FileHandle ;
open($fh, "<", $ARGV[0])
or die "Can't open $ARGV[0]: $!\n" ;
say $fh ;
my $row = $csv->getline($fh) ;
exit
and when I run it, I get:
Desktop>csvtest.pl testcsv.csv
FileHandle=GLOB(0x1e9c20)
Can't call method "getline" on an undefined value at D:\Desktop\csvtes
+t.pl line 16.
I printed out $fh and it was clearly not undefined. The file is a vanilla windows-format file and neither my text editor nor excel nor word have a problem with it. ???
My little test file was pretty trivial:
Importance,Company,Department,"Job Title"