in reply to seek and process from there on

You could try something using the:
$` ($PREMATCH) and $´ ($POSTMATCH)
operators.

Then use your while structure looking for 'need this' running through the contents of the postmatch.

Replies are listed 'Best First'.
Re^2: seek and process from there on
by blazar (Canon) on May 30, 2006 at 13:47 UTC
    You could try something using the:
    $` ($PREMATCH) and $´ ($POSTMATCH)
    operators.

    So he should slurp in the whole file all at once into a string and apply a match to it. Then seems like you're suggesting he will have to

    open my $postmatch, '<', \$' or die $!;

    and search while(<$postmatch>) (or to use some trick along these lines). Very, very smart indeed...