#!/usr/bin/perl use 5.014; # 971051 $/ = "stop combat"; my @array; my $stanza; for ( ) { push @array, $_; } for $stanza ( @array ) { $stanza =~ s/\n/ /g; if ( $stanza =~ /.*?(?=start combat!)(.*?)(?=stop combat)/s ) { my $values = $1; $values =~ s/start combat!//; say "Log Entry: $values"; } else { say "Whoops."; } } __DATA__ soon the combat will begin start combat! Biff! Pow! Bam! (Looks like Batman!) stop combat fight had three superlatives start combat! Smash Bang Boom! stop combat more garbage... here (even tho log is not described as having non-value inclusions. start combat! foo stop combat #### Log Entry: Biff! Pow! Bam! (Looks like Batman!) Log Entry: Smash Bang Boom! Log Entry: foo