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";
}
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|