in reply to Perl:how to find multiple strings
You need a program something like this:
#!/usr/bin/perl use strict; use warnings; my $log = 'log'; @ARGV == 2 or die "usage: $0 TAB_1 TAB_5\n"; my ( $TAB_1, $TAB_5 ) = @ARGV; open my $HAN, '<', $log or die "Cannot open '$log' because: $!"; while ( <$HAN> ) { next unless /^8=/; print "[+] FOUND $TAB_1 and $TAB_5 in\n", "-----------------------\n", $_ if / 1=\Q$TAB_1\E / && / 5=\Q$TAB_5\E /; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl:how to find multiple strings
by auto_w (Novice) on Apr 08, 2011 at 18:04 UTC | |
by jwkrahn (Abbot) on Apr 09, 2011 at 02:58 UTC | |
by auto_w (Novice) on Apr 11, 2011 at 14:28 UTC | |
by auto_w (Novice) on Apr 14, 2011 at 11:27 UTC |