#!/usr/bin/perl -w use strict; use warnings; my $m_1 = "Receive message"; @ARGV == 2 || die "usage: $0 TAB_1 TAB_5\n"; my ( $TAB_11, $TAB_35 ) = @ARGV; my @files = <./*.log>; foreach my $file (@files) { print $file . "\n"; open (my $HAN, $file) || die "Cannot open '$log' because: $!"; while ( <$HAN> ) { next unless /$TAB_11|$TAB_35/; print "Match.$&\n", $_ if /$m_1/; }}
In reply to printing several lines around match by auto_w
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |