[Chicago-talk] Why does Perl hate my csv file?
tigerpeng2001 at yahoo.com
Thu Dec 13 20:15:35 PST 2007
It seems that your $x=<FILE> consumed the whole file.
Is there newline character "\n" in your 1.csv file?How did you invoke the script? How did you change the file name? Is the size of file changed after you change the name?
----- Original Message ----
From: Eric Ellington <e.ellington at gmail.com>
To: Chicago.pm chatter <chicago-talk at pm.org>
Sent: Thursday, December 13, 2007 6:46:26 PM
Subject: [Chicago-talk] Why does Perl hate my csv file?
Using this script:
open(FILE,"1.csv") || die "COULD NOT OPEN FILE: \n$!\n";
my $x = <FILE>;
where 1.csv contains:
I get no output.
Change the file name to 1.txt and I get output or if I comment out "my
$x = <FILE>;" and even then the output is jacked up. Why is that? Does
open do something special when it sees a file that ends in .csv? I
found nothing at http://perldoc.perl.org/functions/open.html or on
This is perl, v5.8.8 built for MSWin32-x86-multi-thread on windows XP.
e.ellington at gmail.com
Chicago-talk mailing list
Chicago-talk at pm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Chicago-talk