in reply to "Use of uninitialized value in print" but why ???
You better print something, like print OUTFILE $lines;. Moreover, it's not optimal to read into memory the whole contents of files. Give this a try:
## Untested open my $match_in, '<', $match_file or die "1st open failed: $!"; open my $fh_in, '<', $in_file or die "2nd open failed: $!"; open my $fh_out, '>>', $out_file or die "3rd open failed: $!"; while (my $lines = <$fh_in>) { while (my $matches = <$match_in>) { chomp $matches; my $matchtmp = qr/$matches.*(?:SUPSOSODEV|AJTSOSO(?:CFD|ISI|CLA))/ +; ## Assuming you want to print $lines print $fh_out $lines if $lines =~ m/$matchtmp/; } } close $fh_out; close $fh_in; close $match_in;
--
David Serrano
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: "Use of uninitialized value in print" but why ???
by mrborisguy (Hermit) on Dec 11, 2005 at 00:33 UTC |