Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^7: Reading tab/whitespace delimited text file

by BrowserUk (Pope)
on Nov 02, 2012 at 11:04 UTC ( #1001945=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Reading tab/whitespace delimited text file
in thread Reading tab/whitespace delimited text file

Any idea as to why this behaves differently for the same set of data ?????

I'll need to see both the exact code you are using and the exact datafile. (I'll /msg you my email id.)


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


Comment on Re^7: Reading tab/whitespace delimited text file
Re^8: Reading tab/whitespace delimited text file
by reaper9187 (Scribe) on Nov 04, 2012 at 19:18 UTC
    Why does the original code behave differently when i use the while(<FILEHANDLE>) loop as a file handle to read a particular section of code(say between line 2-10) instead of using EOF ..???
      Why does the original code behave differently when i use the while(<FILEHANDLE>) loop as a file handle to read a particular section of code(say between line 2-10) instead of using EOF ..???

      Because while( <DATA> ) { reads and discards a line each time it is executed. And that line contains a header (or data) that is required.

      If you need to skip 29 lines, do so before entering the while loop:

      <DATA> for 1 .. 29; until( eof( DATA ) ) { ...

      And to exit the loop after the 40th line has be read:

      until( eof( DATA ) ) { last if $. == 40; ...

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (13)
As of 2014-09-30 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (369 votes), past polls