foreach my $line (@AR_WHOLE_FILE) { if ( $line =~ /EnterCombat/ ) { ( $timestamp ) = split ($line); print $timestamp . "\n"; } }