in reply to Log File Extracter

Is there any reason the following wouldn't work?

my( $header, $time, $error, $status ); while (<>) { /my_header (.*)/ and $header = $1; /time: (.*)/ and $time = $1; /error: (.*)/ and $error = $1; /status: (.*)/ and $status = $1; } $header && $time && $status or die "Error: missing one or more of header, time, status\n";

This is completely flexible with regard to line order, and doesn't even check for the presence of the footer line.

PS - btw - Please don't repost, unless instructed to do so. Posts can be moved. TIA.

A word spoken in Mind will reach its own level, in the objective world, by its own weight