in reply to Seek and delete

Here's a solution using Tie::File:
use Tie::File; tie @array, ’Tie::File’, "filename" or die "tie failed: $!"; # remove the first 100 lines: splice(@array, 0, 100); untie @array;
If you don't know the exact line number, then you could do something like this:
tie @array, 'Tie::File', "filename" or die ...; my $i; for (@array) { if (m/some regex/) { last } $i++; } splice(@array, 0, $i);