Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warning; print "\n Enter The file name :>"; chomp(my $filename1=<STDIN>); open(FILE,"<",$filename1) or die "\n...Cannot find the file: $filename +"; open (W, "> Result.txt"); my @line; while (<FILE>) { push (@line, $_); my $count++; } print W $line [0]; for ($i = 0; $i < $count; $i++) { @st = split (' ', $line [$i]); if (($st [4] eq /chr1/) && ($st [10] eq /chr1/)) { print W $line [$i]; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pattern matching compilation errors
by choroba (Cardinal) on Jun 26, 2012 at 22:07 UTC | |
|
Re: pattern matching compilation errors
by AnomalousMonk (Archbishop) on Jun 26, 2012 at 22:24 UTC | |
|
Re: pattern matching compilation errors
by Kenosis (Priest) on Jun 26, 2012 at 22:26 UTC | |
|
Re: pattern matching compilation errors
by muba (Priest) on Jun 27, 2012 at 01:39 UTC | |
by Kenosis (Priest) on Jun 27, 2012 at 01:49 UTC |