in reply to Writing files

You could use seek() or something like that. Is it the first 32 lines you want? If so you could do:
open FH, $file or die "couldn't open: $!"; @first_32 = map scalar(<FH>), 1..32;

But, the real solution is where are the 32 lines? Are they contiguous? Are the lines always know (like line 10, 13, 33, 45, etc...), or are the 32 lines varied?

Cheers,
KM

Replies are listed 'Best First'.
RE: Re: Writing files
by Anonymous Monk on Jul 28, 2000 at 21:37 UTC
    They are not first 32 lines.But I know the lines. They could be for example line32, 34, 56, 57, 89...etc. Thankx.
      Well, your file isn't too large. You could always do something like the following (sort of ugly):

      open(FH, .....) or die ....; my @lines = <FH>; close FH; my @wanted = @lines[31, 33, 55, 56, 88]; # remember 0 based.

      Cheers,
      KM