in reply to How do I seek to a certain position in a file?

open (FILE, "filename.txt") or die "Could not open filename.txt"; # Store the contents of the file in an array, one line per element my @array = <FILE>; close FILE; # Print line 10 print $array[10];

Replies are listed 'Best First'.
Re: Answer: How do I seek to a certain position in a file?
by Anonymous Monk on Apr 30, 2007 at 01:51 UTC
    If there is a specific pattern you are looking for then you might want to use a if statement and match for the pattern using the ~m/pattern/ Shashidhar Iddamsetty