Perl reads only the last line of my file? -


ok have file list of on 5000 names, 1 line each; file txt file generated microsoft excel. following code gave me output of 1.

open filehandle, "< listname_fc2-3ss>0.txt"; chomp (my @genelist = <filehandle>); close filehandle; print "the number of item in list "; print scalar @genelist; 

i'm using '10 macbook air, perl 5.12.i tried output list , last line of file. tried code on tiny version of 10 names extracted hand myself , worked fine, reckon it's got delimiter?

please help.

ian

try with

local $/ = "\r"; 

before file reading. changes input record separator "\r" character.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -