why do you split this on tabs? If you want to compare the whole line you can compare the lines as in "if ($line_from_hum eq line_from_bact){...}" or something. If you need to extract only a part of the line (say the first three fields) you could use a regex as in:
my ($part_of_line) = ($line=~/^((?:\S+\t){3})/);
One problem in the logic of your code might be that you are comparing lines only from "the point of view" of the human file. Lines in bact that are not in human will not be captured at the moment, which may or may not be what you wanted.
-
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.
|