open (my $fhConditions, "; my $d = join('', @e ); $d =~ s/\s+//g; while (<$fhConditions>) { push (my @line, $_); $count++; } for ($i = 0; $i < $count; $i++) { my @pos = my $line[$i] =~ /chr*\s+(.+?)\s/g; if($pos[0] =~/[0-9]/) { my $match = substr($d,$pos[0],$l); print "$line[$i]" if $match =~m/AAGCTT/; } if($pos[1] =~/[0-9]/) { my $a = $pos[0]-$l; my $match = substr($d,$a,$l); print "$line[$i]" if $match =~m/AAGCTT/; } } #### yntax error at restriction.pl line 13, near "$line[" Execution of restriction.pl aborted due to compilation errors.