Thanks Linuxer,
Here are my changes, now the program finishes and I have no error message but I only have the locus_acc_no = printed out several times and it has no value.
Thanks, B
#!/usr/bin/perl -w
use strict;
use warnings;
use lib "/d/user2/aszend01/BCII/240213";
use ModuleMatching;
my $locus_acc_no = "";
my $key = 1;
print '$key = ', $key, "\n";
# test for not allowing more than one file to work on
unless (1 == scalar(@ARGV)){
die "two many files";
}
# test if the infile cannot be opened
open(IN, $ARGV[0])
or die "unable to open input file $ARGV[0]\n";
while (my $line = <IN>) {
# give the number of records a new key number started with 1 incre
+mented with 1 in each new record devided with "//" signs
if ($line =~ /^\/\//){
$key++;
print '$key = ', $key, "\n";
$locus_acc_no = "";
}
# locus_acc_no
if ($line =~ ModuleMatching::MatchLAC($locus_acc_no)) {
print "locus_acc_no ", $locus_acc_no;
# print $2, "\n";
# $hLocus_Acc{$key} = $1;
# print "%hLocus_Acc{$key} = $1\n";
# $hLength{$key} = $2;
# print "%hLength{$key} = $2\n";
}
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.