use strict; use Tie::File; tie @lines,"Tie::File","< /path/to/my/file.txt" or die "$!"; my $start =; foreach my $ix($start..$#lines) { my $line=$lines[$ix]; #Do the get request magic; }