http://www.perlmonks.org?node_id=1000322

Doozer has asked for the wisdom of the Perl Monks concerning the following question:

Hi! I need help adjusting a foreach loop in a current script to start reading a file from a specific line. I have a script that reads each line in a text file and does a get request on each line (each line is a website hostname). The file lists 1 million hostnames so it is a BIG file.

I had my script running for nearly 2 weeks now and it had got to line 209,848 before I played with CPAN and accidentally stopped the script! This is some pretty important testing I am doing for work so I need to get it back up and running from the last line it got to in the file.

My code for the foreach loop is as follows:

open SOURCE, "</path/to/my/file.txt"; my @lines = <SOURCE>; foreach my $line (@lines) { #Do the get request magic; }
I would really appreciate some help as I have looked online but cant find anything that matches my current method. I would like to tweak the current as little as possible.

Thanks in advance!