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
In reply to Re: "Use of uninitialized value in print" but why ???
by Hue-Bond
in thread "Use of uninitialized value in print" but why ???
by ultibuzz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |