nkpgmartin has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl # @dbarray1 = (); @dbarray5 = (); open(FA, "fa.txt") || die "Cannot find the FA file. \n"; while ($line = <FA>) { chomp($line); @dbarray = split (/ /,$line); push(@dbarray1, $dbarray[1]); push(@dbarray5, $dbarray[5]); } close(FA); open(FB, "fb.tsv") || die "Cannot find the FB file. \n"; while ($line = <FB>) { chomp($line); @array = split (/\s*\|/, $line); foreach (@array) { ($array[103] =~ m/^DB(\d{1,2})/); $db_no = $1; for ($i=0; $i<=$#dbarray1; $i++) { if (($dbarray1[$i] == $db_no) && (/Pointed/)) { $pointed_result = $array[16]*$dbarray5 +[$i]; } # if ($array[10] =~ m/Scan/) if (/Scan/) { $scan_result = $array[16]*$dbarray5[$i +]+20; } } } } close(FB);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: question about if/pattern matching statement
by kyle (Abbot) on Jul 07, 2008 at 19:59 UTC | |
by nkpgmartin (Sexton) on Jul 07, 2008 at 20:50 UTC | |
|
Re: question about if/pattern matching statement
by dragonchild (Archbishop) on Jul 07, 2008 at 19:25 UTC | |
|
Re: question about if/pattern matching statement
by apl (Monsignor) on Jul 07, 2008 at 19:35 UTC |