#!/usr/bin/perl use 5.010; use strict; use warnings; open BLOCKS,'blocks.txt'; open START,'start.txt'; open STOP,'stop.txt'; open NP,'np.txt'; open TRIPLET,'>triplet.txt'; my @blocks=<BLOCKS>; my @start=<START>; my @stop=<STOP>; my @np=<NP>; chomp @blocks; chomp @start; chomp @stop; chomp @np; my $i; my $index=0; my $first; my $second; my $third; my $a=0; my $b=1; my $c=3; my $flag; for($i=0;$i<(scalar(@blocks));$i++) { if($blocks[$index]=~m/^\d.+/) { if ($blocks[$a]=~m/^\d.+/ and $blocks[$b]=~m/^\d.+/ and $block +s[$c]=~m/^\d.+/) { if($np[$a] eq $np[$b] || $np[$a] eq $np[$b] || $np[$b] eq +$np[$c]) { if ($np[$a] eq $np[$b]) { $flag=$np[$a]; print TRIPLET "$start[$a]\t$stop[$a]\t$np[$a]\t$fl +ag\n"; print TRIPLET "$start[$b]\t$stop[$b]\t$np[$b]\t$fl +ag\n"; print TRIPLET "$start[$c]\t$stop[$c]\t$np[$c]\t$fl +ag\n"; } else { $flag=$np[$c]; print TRIPLET "$start[$a]\t$stop[$a]\t$np[$a]\t$fl +ag\n"; print TRIPLET "$start[$b]\t$stop[$b]\t$np[$b]\t$fl +ag\n"; print TRIPLET "$start[$c]\t$stop[$c]\t$np[$c]\t$fl +ag\n"; } } else { #ambigious data print TRIPLET "$start[$a]\t$stop[$a]\t$np[$a]\t$np[$a] +\n"; print TRIPLET "$start[$b]\t$stop[$b]\t$np[$b]\t$np[$b] +\n"; print TRIPLET "$start[$c]\t$stop[$c]\t$np[$c]\t$np[$c] +\n"; } elsif ($blocks[$a]=~m/^\d.+/ && $blocks[$b]=~m/^\d.+/) { if($np[$a] eq $flag || $np[$a] eq $flag) { print TRIPLET "$start[$a]\t$stop[$a]\t$np[$a]\t$flag\n +"; print TRIPLET "$start[$b]\t$stop[$b]\t$np[$b]\t$flag\n +"; } else { print TRIPLET "$start[$a]\t$stop[$a]\t$np[$a]\t$np[$a] +\n"; print TRIPLET "$start[$b]\t$stop[$b]\t$np[$b]\t$np[$b] +\n"; } } else { print TRIPLET "$start[$a]\t$stop[$a]\t$np[$a]\t$np[$a]\n"; } } else { print TRIPLET "$blocks[$index]\n"; } $index++; $a=+2; $b=+2; $c=+2; } close BLOCKS; close START; close STOP; close NP; close TRIPLET; exit;
the error that i get is syntax error at line 60 near "elsif" syntax error at line 81 near "else" syntax error at line 90 near "}" missing right curly or square brackets at the end
In reply to unknown syntax error by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |