This will take care of the first output file quickly and easily:
#! perl -slw
use strict;
use Inline::Files;
my $tally = '';
m[rs(\d{7})] and vec( $tally, $1 - 1e6, 1 ) = 1 while <FILE2>;
m[rs(\d{7})] and vec( $tally, $1 - 1e6, 1 ) and print while <FILE1>;
__DATA__
__FILE1__
chr1 11223 11224 rs2342349
chr2 23423 23424 rs6345435
chr3 64564 64565 rs3432456
chr4 56456 56457 rs7979979
__FILE2__
rs2342349
rs3274234
rs2342344
The second output file makes no sense. The position of what in the first file? The position of what in the second? Number of matching what? Number of non-matching what?
Is that 4 lines (including all the boiler-plate text) for every line in file 1; or file 2? Or every line in file 2 that was matched? Or...
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
In the absence of evidence, opinion is indistinguishable from prejudice.
Not understood.
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.