Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: split function

by rovf (Priest)
on Jan 25, 2012 at 11:22 UTC ( #949877=note: print w/ replies, xml ) Need Help??


in reply to Re^2: split function
in thread split function

It seems that data file can split up to 17th elements and then the rest will start to split on the next line.
I don't see from your output that split would behave in this way, but you can easily verify this, by doing a

print "LINE JUST READ IS: [$_]\n";
just before the split.

-- 
Ronald Fischer <ynnor@mm.st>


Comment on Re^3: split function
Download Code
Reaped: Re^4: split function
by NodeReaper (Curate) on Jan 26, 2012 at 03:47 UTC
Re^4: split function
by tcheungcm (Novice) on Jan 26, 2012 at 08:20 UTC

    Thanks all. I think the problem is happened on the readline. After I add the line before the split

     print "Line just read is $_\n";

    the output is

    Line just read is 1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;

    Line just read is 21;22;23;24;25;26;27;28;29;30;31;32;33;34;35;36

    I also checked the lenght of each line is limited 51. Anyone would have clue?

      Have a clue about what?

      Hopefully you're sufficiently convinced split function isn't broken, so your question is?

        I don't think split function is an issue. it's something related when I tried to read a file. it only read the line up to length = 51 and then it will continue to read on the nextline. I already checked the file, there is no newline in the file.

      Did you hexdump your data file?

      -- 
      Ronald Fischer <ynnor@mm.st>

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://949877]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2015-07-04 17:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls