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]; } }
In reply to pattern matching compilation errors by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |