Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Re: Skip 21 Lines

by turnstep (Parson)
on Apr 24, 2001 at 20:28 UTC ( #75127=note: print w/ replies, xml ) Need Help??

in reply to Re: Skip 21 Lines
in thread Skip 21 Lines

open (DATA, "<file.txt") or die "Can't open file $!\n"; <DATA> while $. < 21; my @DATA = <DATA>; close (DATA);

Comment on Re: Re: Skip 21 Lines
Download Code
Replies are listed 'Best First'.
Re: Re: Re: Skip 21 Lines
by MeowChow (Vicar) on Apr 25, 2001 at 11:24 UTC
    Nice use of an obscure variable (the obfuscator in me salutes you), but you'd better hope that the file is at least 22 lines long, or you'll be waiting quite a while for your data :-)
                   s aamecha.s a..a\u$&owag.print
      Point taken (although I don't think of $. as particularly obscure.) Slight modification:
      1 while <DATA> and $. < 21;

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2015-11-29 20:36 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (753 votes), past polls