ultibuzz has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; my $out_file = "out.txt"; my $match_file = "pattern.txt"; my $in_file = "20051208.LOG"; open(my $match_in, '<', $match_file) or die("open failed: $!"); my @matches = <$match_in>; close($match_in); open(my $fh_in, '<', $in_file) or die("open failed: $!"); my @lines = <$fh_in>; close($fh_in); open(OUTFILE, '>>', $out_file) or die("open failed: $!"); foreach my $lines (@lines) { foreach my $matches (@matches) { chomp($matches); my $matchtmp = $matches . ".*SUPSOSODEV" . '|' . $matches . ".*AJT +SOSOCFD" . '|' . $matches . ".*AJTSOSOISI" . '|' . $matches . ".*AJTS +OSOCLA"; if($lines =~ qr/$matchtmp/) { print OUTFILE; } } close(OUTFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "Use of uninitialized value in print" but why ???
by GrandFather (Saint) on Dec 10, 2005 at 19:26 UTC | |
|
Re: "Use of uninitialized value in print" but why ???
by xdg (Monsignor) on Dec 10, 2005 at 19:19 UTC | |
|
Re: "Use of uninitialized value in print" but why ???
by Hue-Bond (Priest) on Dec 10, 2005 at 19:33 UTC | |
by mrborisguy (Hermit) on Dec 11, 2005 at 00:33 UTC | |
|
Re: "Use of uninitialized value in print" but why ???
by ultibuzz (Monk) on Dec 10, 2005 at 19:19 UTC |