in reply to Newbie : Data mining question

for ( $content =~ /^(Server error:\n.*?)^server info/gsm ) { print if /Btree/; }

We're not surrounded, we're in a target-rich environment!

Replies are listed 'Best First'.
Re^2: Newbie : Data mining question
by ikegami (Patriarch) on Oct 29, 2007 at 20:40 UTC

    Replacing for with while would save memory at no cost.

    Update: Oops, not quite true. It would involve copying $1 into some other variable, so it might lose speed.

    while ( $content =~ /^(Server error:\n.*?)^server info/gsm ) { my $record = $1; print $record if $record =~ /Btree/; }