Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^9: Reading tab/whitespace delimited text file

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

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

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002312]
[Corion]: Once more, I'm looking for a sane client-side framework, but I guess these don't exist. Everything I look at either uses a weirdo home-grown templating language (like Angular in all its incarnations) or uses weirdo Javascript incarnations (like ...
[Corion]: ... Inferno.js, which uses ES2015) or uses some horrible amount of Javascript infrastructure before you can even render a single file.
[Corion]: I'd really like to create a dynamic frontend for my Google Keep clone, but so far, all the templating solutions seem to bring their own template language or require me to hand-code everything in (their own flavour of) Javascript. I'd like something ...
[Corion]: ... that can use templates from the HTML (via <script language="text/ template">... my template ...</script> and otherwise gets out of my way. But it seems that is not how the Javascript world is, currently :-/
[Corion]: I guess my question is, has anybody worked with React, Ember, Angular (v2, v4, v.whatever) or any other JS client-side dynamic rendering/virtual DOM thingie and found a simple, single-file solution like jQuery?

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2017-03-27 19:00 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (321 votes). Check out past polls.